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

feat(sqlparser): support more update syntaxes + fix bug with subqueries #9105

Merged
merged 5 commits into from
Oct 30, 2023

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Oct 25, 2023

Handles more edge cases in UPDATE statement CLL, and also fixes a bug with our generation of CLL of subqueries (we'd previously miss some columns, and also generate some incorrect lineage).

Adds test cases related to those, and also checked that this has no negative impact with our private query corpus. For some queries that we don't handle correctly right now, I've also added test cases in skip mode so that we can turn them on once we get them to work properly.

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 Oct 25, 2023
@maggiehays maggiehays added the hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ label Oct 26, 2023
# Update statements always implicitly have the updated table in context.
# TODO: Retain table name alias.
if select_statement.args.get("from"):
# select_statement = sqlglot.parse_one(select_statement.sql(dialect=dialect))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do in a follow-up

Copy link
Collaborator Author

@hsheth2 hsheth2 Oct 30, 2023

Choose a reason for hiding this comment

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

done in here 87d0b06

@hsheth2 hsheth2 merged commit ce0f36b into datahub-project:master Oct 30, 2023
55 checks passed
@hsheth2 hsheth2 deleted the sqlparse-self-update branch October 30, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants