Skip to content

Fix merge queries #375

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 5 commits into from
Jun 4, 2023
Merged

Fix merge queries #375

merged 5 commits into from
Jun 4, 2023

Conversation

ulixius9
Copy link
Contributor

@ulixius9 ulixius9 commented May 23, 2023

In case merge queries for bigquery following are the cases that needs to be handled:

  • The INTO keyword after MERGE is optional
  • The column references after INSERT are optional for example INSERT VALUES (actual...values)
  • The subquery after USING keyword can be a CTE query (this is not specific to bigquery)

part of fix for open-metadata/OpenMetadata#7427 ref1 ref2

Closes #380

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #375 (2f1bfa5) into master (3c52d3d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #375   +/-   ##
=======================================
  Coverage   99.39%   99.39%           
=======================================
  Files          42       42           
  Lines        1975     1981    +6     
=======================================
+ Hits         1963     1969    +6     
  Misses         12       12           
Impacted Files Coverage Δ
.../parser/sqlfluff/extractors/dml_merge_extractor.py 100.00% <100.00%> (ø)
sqllineage/core/parser/sqlparse/analyzer.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@reata
Copy link
Owner

reata commented May 23, 2023

I'll review this code tomorrow. Thanks for your contribution.

Copy link
Owner

@reata reata left a comment

Choose a reason for hiding this comment

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

I don't have the full picture regarding what feature in MERGE statement is ANSI compatible and what's not. Can you help take a look? Rule of thumb, if it's ANSI compatible, move the test case to test_others.py. If not, list all the supported dialect for each test case. And add some comment on what feature makes each test case dialect specific.

@ulixius9 ulixius9 changed the title Fix merge queries for bigquery Fix merge queries May 25, 2023
@reata reata added the enhancement New feature or request label Jun 4, 2023
@reata reata merged commit 4dd361c into reata:master Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQuery Specific MERGE statement feature support
2 participants