Steve Carlin has uploaded this change for review. (
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
---
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/AnalyzedInPredicate.java
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
2 files changed, 10 insertions(+), 11 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/06/24006/3
--
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: newchange
Gerrit-Change-Id: I397b8e3438d8f5d59725bed6fc166f842596818f
Gerrit-Change-Number: 24006
Gerrit-PatchSet: 3
Gerrit-Owner: Steve Carlin <[email protected]>