-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-8592] Adjusting ZetaSQL table resolution to standard #10021
Conversation
run sql postcommit |
Amazingly, since I can't run the tests locally, the ZetaSQL precommit passed. |
I'm expecting the data catalog postcommit to fail. |
s/amazingly/suspiciously/g Investigating the gradle scans |
ad8d35c
to
983917f
Compare
run sql postcommit |
OK, confirmed that it works at least for the test coverage we have. Pushing a tiny cleanup. I'm on Mac now so I cannot confirm it so quickly. |
6f47280
to
5733ce9
Compare
run sql postcommit |
run sql precommit |
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.
My only question is, as JoinCompoundIdentifiersTest.java
will be deleted, seems like we will lose all unit tests on table resolution?
"join compound identifiers" table resolver is removed. In fact, all uses of I will take another look at the test file and see if there are tests that should be in unit tests of some other class. |
5733ce9
to
1d40671
Compare
I took another look and I think all the functionality tested by that file is gone. |
Let me ask in another way: do we need unit tests for table resolution? If so, can you add some? |
Thanks for clarifying. That makes sense. I will review the existing tests and make sure we have coverage of a few different situations. For example I noticed that |
1d40671
to
9869aa2
Compare
Ah. Now that I have looked closer, these tests were running against Since ZetaSQL table reference (list of strings) is the same structure as a Calcite table reference (list of strings), the main thing that is helpful is just unit testing of the one real method of |
0b300b1
to
e42343b
Compare
run sql postcommit |
Please take another look. I have restored unit testing to ensure that |
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.
LGTM.
Might be worth adding a test for tables with dot in their name.
return TableResolver.DEFAULT_ASSUME_LEAF_IS_TABLE; | ||
// Set up table providers that need to be pre-registered | ||
// TODO: share this logic between dialects, set up tables on JDBC connection too | ||
|
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.
nit:Extra whitespace?
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.
Done & filed a Jira for this TODO
* the getSubschema() path until the second-to-last path element. We expect the path to be a table | ||
* path, so the last element should be a valid table id, we don't expect anything else there. | ||
* | ||
* <p>This resembles a default Calcite planner strategy. One difference is that Calcite doesn't |
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.
A bit of this comment might still be useful in explaining what this is doing.
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.
Done.
@@ -134,6 +136,11 @@ public RelRoot rel(String sql, Map<String, Value> params) { | |||
|
|||
QueryTrait trait = new QueryTrait(); | |||
|
|||
// Set up table providers that need to be pre-registered | |||
// TODO: share this logic between dialects, set up tables on JDBC connection too |
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.
Nit: JIRA for the todo?
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.
Done
e42343b
to
671b02a
Compare
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.
Good point about dots in names. Added tests for those in table name and also schema. It only tests the table resolution logic, not the parser. I feel it is probably not our job to test the parser.
* the getSubschema() path until the second-to-last path element. We expect the path to be a table | ||
* path, so the last element should be a valid table id, we don't expect anything else there. | ||
* | ||
* <p>This resembles a default Calcite planner strategy. One difference is that Calcite doesn't |
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.
Done.
return TableResolver.DEFAULT_ASSUME_LEAF_IS_TABLE; | ||
// Set up table providers that need to be pre-registered | ||
// TODO: share this logic between dialects, set up tables on JDBC connection too | ||
|
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.
Done & filed a Jira for this TODO
@@ -134,6 +136,11 @@ public RelRoot rel(String sql, Map<String, Value> params) { | |||
|
|||
QueryTrait trait = new QueryTrait(); | |||
|
|||
// Set up table providers that need to be pre-registered | |||
// TODO: share this logic between dialects, set up tables on JDBC connection too |
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.
Done
run sql postcommit |
Because I am developing on Mac and ZetaSQL does not support Mac I cannot run the required unit tests so easily. Uploading to run them.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.