Repository navigation
Add SQLGlot parser support #24729
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
Merged
Merged
Add SQLGlot parser support #24729
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
e1bc29f
Add SQLGlot parser support
mohittilala ee33434
Add query_hash to all lineage parsing logs for better tracking
mohittilala fd5c23b
Better logging of parser logs
mohittilala 5a7eac8
Merge branch 'main' into sqlglot-support
mohittilala cb44e01
Merge branch 'sqlglot-support' of github.com:open-metadata/OpenMetada…
mohittilala 95a1674
Cache db service lookups to reduce repeated searches
mohittilala 658cac9
sqlglot query masking fallback to sqlparse and better logging to track
mohittilala 95cf8b3
Consistent logs for query parsing with all useful information
mohittilala 0419aa9
Add query masking tests for all parsers
mohittilala d6a8eed
Remove duplicate query masking tests
mohittilala 862b9f2
Add specific dialect sql tests and helper methods to test/compare all…
mohittilala f1ff677
py_format
mohittilala 8cbb924
Add tests for large set of complex query patterns to validate all par…
mohittilala 6430cfa
Add memory limits on lineage query parsers with default 100mb limit
mohittilala 0552fb4
Better memory limit handling and more tests
mohittilala 2727ca7
Merge branch 'main' into sqlglot-support
mohittilala 05cd0bf
Remove query parsing issue summary since it's killing the workflow wh…
mohittilala c637e18
py_format
mohittilala 026bddc
Add e2e lineage tests for oracle db and fix oracle query lineage filters
mohittilala 3ae5b6d
py_format
mohittilala 8f04040
Remove SqlGlot parsing from query masker
mohittilala 01d6ab8
Add __init__.py to query test packages
mohittilala 3e0ecde
Better logs to track get lineage method
mohittilala cb8bc61
Disable memory limits for now as they are performance overhead
mohittilala 6dcfc27
Update sql file path for e2e oracle db lineage tests
mohittilala 9f585fe
TEMP: Add local rc build of latest sqllineage with sqlglot support fo…
mohittilala 4921084
Revert search_cache name change in sql_lineage.py
mohittilala 079bf22
Handle tests hanging with timeouts caused by graph checks or heavy qu…
mohittilala 82bbfa0
Complex query test formatting
mohittilala d0d8a64
py_format
mohittilala 7c65077
Handle complex query tests with appropriate flags #01
mohittilala cc04d3e
Handle complex query tests with appropriate flags #02
mohittilala 2bd3ecd
Handle complex query tests with appropriate flags #03
mohittilala 05f4a4d
Handle complex query tests with appropriate flags #04 (final)
mohittilala a279b38
Update query lineage test helper for better troubleshooting
mohittilala cc4c1c5
Merge branch 'main' into sqlglot-support
mohittilala 712cfa0
Add dialect specific query masking tests and skip sqlglot failures fo…
mohittilala 4c316da
Fix or skip other failing test related to sqlglot changes
mohittilala 3e79bc2
Merge branch 'sqlglot-support' of github.com:open-metadata/OpenMetada…
mohittilala 589cf9d
py_format
mohittilala fb76a34
Reduce sleep between proc calls for faster tests
mohittilala 3f906d8
Merge branch 'main' into sqlglot-support
mohittilala 8d1f5a9
Merge branch 'sqlglot-support' of github.com:open-metadata/OpenMetada…
mohittilala 7597449
Remove default test diff limit and skip graph check that timeout in c…
mohittilala a397987
Clear the topology runner cache in test to have cleaned state
mohittilala 04320f5
Skip flaky graph check timeouts on test
mohittilala 15b4a7b
Handle no parser in mask_query and log every message as debug to not …
mohittilala ae6ef04
Update parser logs to debug for less verbosity on default log level
mohittilala 21a8045
Remove TEMP collate-sqllineage whl added for test since 2.0.0 is out
mohittilala a50de20
Log maximum 10 failures in workflow summary to not overload ingestion
mohittilala db801ac
Cleanup oracle db image after lineage e2e tests
mohittilala 9df335b
Remove query parsing failures tracking from sql lineage process
mohittilala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if i understand this fully?? why can't we build a making with sqlglot - using sqlparse here would not achieve the performance improvements we are expecting
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sqlglot normalizes sqls after parsing and doesn't retain original sql content.
for reference (masking with sqlglot):
here, type casting
birthdate=DATE ?is normalized tobirthdate = CAST(? AS DATE)and there is no option for us to disable this behaviour as it's intended use-case of sqlglot.ideally, this is not an issue but when sql is complex and sqlglot does any mistake in converting sql then we wouldn't even get the original sql so can't rely 100% on the parsing/conversion capabilities of sqlglot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code reference:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sqlparse parsing time is almost same as sqlglot so here it would be 2x time than expectation but no workaround for now.