Steve Carlin has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/24006 )
Change subject: IMPALA-14758: Calcite planner: Return value with "in" and case
statement crashes server.
......................................................................
IMPALA-14758: Calcite planner: Return value with "in" and case statement
crashes server.
The following query was crashing the server with the Calcite planner:
SELECT a.id, a.int_col, a.string_col FROM alltypessmall a
WHERE 1 NOT IN
(SELECT CASE WHEN id = 1 then null ELSE id END FROM alltypestiny)
The AnalyzedInPredicate was setting the savedFunction before the case
statement was analyzed. At this point, the case statement had an invalid
type for its return type. The getFunction() for the in clause was
being set to null which caused bad things to happen on the server.
The fn_ variable is now set at analyze time when the case statement
is assured to have a return type.
Change-Id: I397b8e3438d8f5d59725bed6fc166f842596818f
Reviewed-on: http://gerrit.cloudera.org:8080/24006
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/AnalyzedInPredicate.java
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
3 files changed, 15 insertions(+), 16 deletions(-)
Approvals:
Impala Public Jenkins: Looks good to me, approved; Verified
--
To view, visit http://gerrit.cloudera.org:8080/24006
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I397b8e3438d8f5d59725bed6fc166f842596818f
Gerrit-Change-Number: 24006
Gerrit-PatchSet: 6
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>