Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest/tableau): split table columns query from datasources query #8217

Conversation

mayurinehate
Copy link
Collaborator

@mayurinehate mayurinehate commented Jun 12, 2023

If datasource has multiple upstream tables and upstream tables have large number of columns, NodeLimitExceeded Error occurs even with page_size:1. This PR splits the query into two - first to get upstream tables of datasource and then to get columns of upstream table so that less number of nodes are fetched in query.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jun 12, 2023
@mayurinehate mayurinehate changed the title Tableau datasource table query split fix(ingest/tableau): split table columns query from datasources query Jun 12, 2023
@@ -388,15 +419,7 @@ class TableauProject:
@capability(SourceCapability.TAGS, "Requires recipe configuration")
@capability(SourceCapability.LINEAGE_COARSE, "Enabled by default")
class TableauSource(StatefulIngestionSourceBase):
config: TableauConfig
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed at class level.

self.config = config
self.report = StaleEntityRemovalSourceReport()
self.server = None
self.upstream_tables = {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed upstream_tables variable. Replaced with database_tables which is better typed.

@@ -189,17 +189,15 @@ class MetadataQueryException(Exception):
upstreamTables {
id
name
isEmbedded
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to tables query

database_table_id_to_urn_map[table[tableau_constant.ID]]
]
columns = table.get(tableau_constant.COLUMNS, [])
is_embedded = table.get(tableau_constant.IS_EMBEDDED) or False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table.get(tableau_constant.IS_EMBEDDED, False)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isEmbedded is optional boolean. If its returned as None in graphql, then I would like to set is_embedded as False, which is not the case if we use suggested construct(which outputs None). I'd prefer to keep it as is.
https://help.tableau.com/current/api/metadata_api/en-us/reference/databasetable.doc.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, sure, thanks

type=SchemaFieldDataType(type=TypeClass()),
description="",
nativeDataType=nativeDataType,
dataset_snapshot = DatasetSnapshot(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get rid of DatasetSnapshot if possible in the long term

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I just moved the existing pieces around, will track and address this in followup, if its okay.

schema_field = SchemaField(
fieldPath=field[tableau_constant.NAME],
type=SchemaFieldDataType(type=TypeClass()),
description="",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is description a non-nullable field otherwise, I think omitting it would be better.

fields.append(schema_field)

schema_metadata = SchemaMetadata(
schemaName="test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why schemaName is hardcoded test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK schemaName is not used anywhere. Not clear about the impact of changing this. Also not sure what should be set as value of schemaName .

@treff7es treff7es merged commit 88ceac3 into datahub-project:master Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants