Skip to content

Conversation

@chezou
Copy link
Contributor

@chezou chezou commented May 1, 2022

Since Trino uses WITH for bucketing without Identifier after WITH,
allow Parenthesis after WITH.
https://trino.io/blog/2019/05/29/improved-hive-bucketing.html

Close #251

@reata
Copy link
Owner

reata commented May 2, 2022

@chezou Thanks for contributing. I just approved the CI test. Could you fix the failed flake8 check first?
You can refer to https://github.com/reata/sqllineage/blob/master/CONTRIBUTING.md to set up a local testing environment using tox, which is exactly the same process as GitHub Actions.

@chezou
Copy link
Contributor Author

chezou commented May 2, 2022

@reata Thanks, I think I ran tox on my local env, but will rerun and fix them.

chezou added 2 commits May 2, 2022 09:24
@chezou
Copy link
Contributor Author

chezou commented May 2, 2022

@reata Fixed by confirming local tox and force pushed the commit. Can you approve to run GitHub workflow?

@reata
Copy link
Owner

reata commented May 4, 2022

@reata Fixed by confirming local tox and force pushed the commit. Can you approve to run GitHub workflow?

Approved. Sorry I might be slow to respond recently because the covid-19 lockdown in Shanghai took a lot of energy from me. Please don't be discouraged. I really appreciate it.

@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #252 (8ee1b34) into master (f86c1ef) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #252   +/-   ##
=======================================
  Coverage   99.01%   99.02%           
=======================================
  Files          20       20           
  Lines         918      924    +6     
=======================================
+ Hits          909      915    +6     
  Misses          9        9           
Impacted Files Coverage Δ
sqllineage/core/handlers/cte.py 100.00% <100.00%> (ø)
sqllineage/core/models.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f86c1ef...8ee1b34. Read the comment docs.

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.

This PR looks good to me. It helps if you can answer some of my inline questions.

elif isinstance(token, Parenthesis):
# CREATE TABLE tbl1 (col1 VARCHAR) WITH (bucketed_by = ARRAY['col1'], bucket_count = 256).
# This syntax is valid for bucketing in Trino and not the CTE
self._handle(token.tokens[1], holder)
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we still want to handle token.tokens[1] here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed on 8ee1b34

I originally thought the parenthesis should be parsed, but looking at the examples, no longer needed.

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.

LGTM

@reata reata merged commit c8e71f4 into reata:master May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in parsing WITH for bucketing in Trino

2 participants