-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CALCITE-6605] Lattice SQL supports complex column expressions #3987
Conversation
/** Test case for | ||
* <a href="https://issues.apache.org/jira/browse/CALCITE-6605">[CALCITE-6605] | ||
* Lattice SQL supports complex column expressions </a>. */ | ||
@Test void testExpressionLatticeSql() throws Exception { |
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.
Maybe you can add some blank lines or a method to make the test sample code more readable.🤔
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.
Added description for tests.
return new SqlImplementor.SimpleContext(dialect, fieldFuncRef[0]) | ||
.toSql(null, ((DerivedColumn) column).e); | ||
} | ||
throw new UnsupportedOperationException(); |
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.
This probably should have some more descriptive error
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.
+1
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.
It will be called when lattice column generates sql.
final Column column = columns.get(i);
column.toSql(w);
Originally, for DerivedColumn
, the UnsupportedOperationException
will be thrown directly. This PR will obtain the corresponding column based on index and return the field object.
Currently there are only two types of columns: BaseColumn
, DerivedColumn
, theoretically no exception will be thrown. But in order to avoid extreme cases that are not covered, the logic of throwing exceptions before is also retained.
Quality Gate passedIssues Measures |
https://issues.apache.org/jira/browse/CALCITE-6605