Hello Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/25226

to look at the new patch set (#2).

Change subject: IMPALA-15691 Fix INVALID_TYPE issue for NULL predicates
......................................................................

IMPALA-15691 Fix INVALID_TYPE issue for NULL predicates

PROBLEM DESCRIPTION:
Queries involving NULL predicates can fail during analysis
using the Calcite planner. For example:
    SELECT a.id, a.int_col, a.string_col
    FROM functional_parquet.alltypessmall a
    WHERE NULL NOT IN (SELECT null);
The query fails with the following exception:
    RuntimeException: Unknown type INVALID_TYPE
During type coercion, FunctionUtils.resolveFunction() selects the
is_null_pred(VARIANT) overload.
FunctionResolutionOrder sorts function overloads according to their
getPrimitiveType().ordinal() values. However, VariantType does not
override getPrimitiveType() and therefore inherits the implementation
in Type.java, which returns INVALID_TYPE.As a result, the VARIANT
overload is ordered based on INVALID_TYPE,leading to incorrect
 function resolution.

SOLUTION DESCRIPTION:
Reposition INVALID_TYPE in the PrimitiveType enum. Moving it
from the beginning of the enum to the last position.

TESTS:
The failure can be reproduced with  this simplified ©query:
   SELECT NULL IN (SELECT NULL);
The simplified query has been added to calicite.test
Sanity tests executed:
   test_calcite_planner.py
   test_exprs.py
Jenkins tests:
   FE_TEST
   BE_TEST
   EE_TEST

Change-Id: Id06b23cb958566a5a90cc321fe215d8c2a634b71
---
M fe/src/main/java/org/apache/impala/catalog/PrimitiveType.java
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
2 files changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/26/25226/2
--
To view, visit http://gerrit.cloudera.org:8080/25226
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id06b23cb958566a5a90cc321fe215d8c2a634b71
Gerrit-Change-Number: 25226
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>

Reply via email to