-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Enhancement] Support the array join syntax of Clickhouse #67268
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
base: main
Are you sure you want to change the base?
Conversation
|
@cursor review |
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.
✅ Bugbot reviewed your changes and found no bugs!
Signed-off-by: zhaorui25 <[email protected]>
8906e59 to
966a927
Compare
|
@cursor review |
|
| private boolean isLeftJoin = false; | ||
|
|
||
| private boolean isArrayJoin = false; | ||
|
|
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.
Copy constructor omits isArrayJoin flag
The TableFunction copy constructor does not copy the new isArrayJoin field (nor the pre-existing isLeftJoin field). When copy() is called on a TableFunction that has isArrayJoin set to true, the copied function will have isArrayJoin as false (the default value), losing the flag. While the current ARRAY JOIN implementation doesn't call copy() on the function after setting this flag, future code modifications could trigger this bug, causing the array size validation in the backend to be silently skipped.
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]❌ fail : 7 / 9 (77.78%) file detail
|
[BE Incremental Coverage Report]❌ fail : 0 / 7 (00.00%) file detail
|



Why I'm doing:
Support the array join syntax of Clickhouse, eg:
select id, c1 from t1 array join array_col as c1What I'm doing:
Convert ARRAY JOIN to UNNSET + LATERAL JOIN
eg:
ARRAY JOIN array_col To JOIN LATERAL UNNEST(array_col)LEFT ARRAY JOIN array_col To LEFT JOIN LATERAL UNNEST(array_col)Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
Note
Introduces ClickHouse-style
ARRAY JOINsyntax by rewriting it toLATERAL UNNEST, with left join support and correctness checks.arrayJoinClause; inAstBuilder, transformARRAY JOIN ...(andLEFT ARRAY JOIN ...) intoJOIN LATERAL UNNEST(...), set aliases, output column names, and join typeQueryAnalyzer, propagateisLeftJoinand newisArrayJointoTableFunction; keep lateral join constraints forunnestis_array_jointoTTableFunction(Thrift) and FETableFunction; add_is_array_join_modeto BETableFunctionStatewith getters/settersMultiUnnest, validate all arrays have equal length when in array-join mode, error if mismatched; preserve left-join null fillingARRAY JOINandLEFT ARRAY JOINon arraysWritten by Cursor Bugbot for commit 966a927. This will update automatically on new commits. Configure here.