mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
This fix is needed before the join optimization fix can be committed. The JoinTranspose rule provided by Calcite was having 2 issues: 1) For tpcds-q10 and q35, an exception was being thrown. There is a bug in the Calcite code when the Join-Project gets matched but the Join is of reltype SemiJoin. In this case, the Projects do not get created correctly and the exception gets thrown. 2) We only want to transpose a Project above a Join if there is an underlying Join underneath the Project. The whole purpose is to be able to create adjacent Join RelNodes. We do not have to transpose the Project when it is not sandwiched between two Join nodes. It is preferable to keep it underneath the Join since the row width calculation would be affected (the Project may reduce the number of columns, thus reducing the row width). This commit extends the given JoinProjectTranspose rule by Calcite and handles these added restrictions. Change-Id: I7f62ec030fc8fbe36e6150bf96c9673c44b7da1b Reviewed-on: http://gerrit.cloudera.org:8080/23313 Reviewed-by: Aman Sinha <amsinha@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>