[CALCITE-7688] Support scalar subqueries in table function arguments - #5144
Conversation
1dff2ed to
6e89888
Compare
|
the commit message is not ideal. |
|
@mihaibudiu It's a habit from the IGNITE project, where they don't pay as much attention to commit messages. It's ready for review, could you take a look? |
|
I will review, but to merge this you will have to use the same commit message as the JIRA issue title. |
mihaibudiu
left a comment
There was a problem hiding this comment.
I am not sure that the interpreter module is being actively maintained or complete. Some of the changes in this PR seem not directly related to the actual JIRA issue 7688. The SubQueryRemoveRule is what should be the focus of this PR.
If you want to bring the interpreter up-to-date, please check for JIRA issues related to that or file new ones and submit that part of the work as separate PRs.
mihaibudiu
left a comment
There was a problem hiding this comment.
This generally looks fine
| "row_name=row 2; c1=103; c2=106"); | ||
| } | ||
|
|
||
| @Test void testTableFunctionWithScalarQueryLiteralAndColumnArguments() { |
There was a problem hiding this comment.
I hope that you have validated these results in some way.
Maybe you can say how.
Ideally you wrote a test oracle (a separate program) which verified these results.
There was a problem hiding this comment.
I validated the expected results independently against Oracle using a standalone PL/SQL test oracle https://onecompiler.com/plsql/44xe3ubj8. The program defines a pipelined table function and invokes it with the same scalar subquery, literal, and correlated outer-column arguments. Oracle produced (100, 10, 20, 100) and (200, 10, 20, 200), which matches the test expectations.
Or did you mean something else?
| public static final Method MULTIPLICATION_TABLE_METHOD = | ||
| Types.lookupMethod(Smalls.class, "multiplicationTable", int.class, | ||
| int.class, Integer.class); | ||
| public static final Method SCALAR_QUERY_ARGUMENTS_TABLE_METHOD = |
There was a problem hiding this comment.
I wonder why this file is named Smalls.java.
There was a problem hiding this comment.
Smalls like teen spirit.
|
Please squash the commits for merging |
efa7446 to
b5fa592
Compare
|
@mihaibudiu Done. |
|



Jira Link
CALCITE-7688
Changes Proposed
This PR introduces support for scalar subqueries and expressions containing scalar subqueries in table function arguments: