[ 
https://issues.apache.org/jira/browse/BEAM-9075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17016080#comment-17016080
 ] 

Brian Hulette commented on BEAM-9075:
-------------------------------------

I looked into option 1). It's easy to just fix JoinCommuteRule, but I think the 
patch is unlikely to be accepted in Calcite unless its part of a larger change 
to add a flag for disabling struct flattening. To that end, I also looked into 
the 29 test failures that result from removing PlannerImpl:257, in order to 
identify the other rules that need to be updated. But as someone new to the 
Calcite codebase I had a hard time figuring out what needed to be fixed to 
resolve the failures.

There is another option that we had discussed offline: 3) Fork our own 
JoinCommuteRule that supports non-flattened structs.

Its not a great solution, but maybe something we should do anyway given that 
everything else will have us waiting on a Calcite release.

> Join re-ordering doesn't work for ZetaSQL
> -----------------------------------------
>
>                 Key: BEAM-9075
>                 URL: https://issues.apache.org/jira/browse/BEAM-9075
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql-zetasql
>    Affects Versions: 2.17.0
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Join re-ordering can actually break queries in the ZetaSQL planner because 
> Calcite's JoinCommuteRule doesn't work when schemas have nested fields. It 
> only adjusts RexInputRef nodes and not RexFieldAccess.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to