Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/25226 )

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


Patch Set 3:

(2 comments)

Thanks, this is looking good to me, just a minor nit.

http://gerrit.cloudera.org:8080/#/c/25226/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/25226/2//COMMIT_MSG@27
PS2, Line 27: overloads of is_null_pred and is_not_null_pred. The original 
planner
            : is not affected because it casts a NULL operand to B
> I'm a bit mixed on this.  I think your solution is reasonable and makes sen
I don't necessarily see the enum change as risky. I do think it is awkward. If 
we're doing numeric comparisons of things with INVALID_TYPE, I think that's a 
weird concept.

Another piece of hardening we could do is for 
FunctionResolver::getImpalaFunction() to confirm that the function it picked 
has scalar arguments:

    // Calcite has no equivalent for non-scalar types (e.g. VARIANT), so 
resolving to
    // such an overload would only fail later with an obscure type conversion 
error.
    for (Type argType : fn.getArgs()) {
      Preconditions.checkState(argType.isScalarType(), "Function %s resolved to 
" +
          "signature %s with non-scalar argument type %s, which is not 
supported " +
          "by the Calcite planner", lowercaseName, fn.signatureString(), 
argType);
    }

I'm not sure if that would be a problem later when we add support for complex 
types.


http://gerrit.cloudera.org:8080/#/c/25226/3/fe/src/main/java/org/apache/impala/util/FunctionUtils.java
File fe/src/main/java/org/apache/impala/util/FunctionUtils.java:

http://gerrit.cloudera.org:8080/#/c/25226/3/fe/src/main/java/org/apache/impala/util/FunctionUtils.java@158
PS3, Line 158:       return t.isVariantType() ? Integer.MAX_VALUE : 
t.getPrimitiveType().ordinal();
Nit: One layer of protection we can add is to assert that Variant is the only 
exception. i.e.

if (t.isVariantType()) return Integer.MAX_VALUE;
Preconditions.checkState(t.isScalarType(),
  "Unexpected non-scalar type in function signature: %s", t);
return t.getPrimitiveType().ordinal();



--
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: comment
Gerrit-Change-Id: Id06b23cb958566a5a90cc321fe215d8c2a634b71
Gerrit-Change-Number: 25226
Gerrit-PatchSet: 3
Gerrit-Owner: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Fri, 30 Oct 2026 17:35:28 +0000
Gerrit-HasComments: Yes

Reply via email to