Zoltan Borok-Nagy has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/24881


Change subject: IMPALA-15371: Support IS [NOT] NULL on VARIANT columns
......................................................................

IMPALA-15371: Support IS [NOT] NULL on VARIANT columns

'v IS NULL' and 'v IS NOT NULL' were rejected during analysis for
VARIANT columns. The reason was that there was no is_null_pred()
builtin for VARIANT: the builtins are registered for the types of
Type.getSupportedTypes(), which are all scalar, and when VARIANT read
support was added a VARIANT had no expression ABI yet. So the check
only turned a "no matching function" error into a clearer message.

Since IMPALA-15057 a VARIANT is a self-contained value (VariantVal) at
the UDF boundary, just like the scalar types, therefore the builtins
can simply be instantiated for it.

Only SQL NULL is NULL. A variant null in the column is a regular value,
so 'v IS NULL' is false for it. Note that variant_get() does return SQL
NULL when there is a variant null at the path, hence
variant_get(v, '$') IS NULL can differ from v IS NULL.

The predicate is pushed down to Iceberg the same way as for the other
types. This is safe: Iceberg only uses it to prune whole files by their
NULL counts, which it derives from the required metadata column of the
VARIANT, and it never replaces the evaluation of the predicate.

Testing:
* FE: extended AnalyzeExprsTest.TestIsNullPredicates
* e2e tests added

Change-Id: Id0b17821f6c8a988abf93494b7dbeb8f6f7db216
Assisted-by: Claude Fable 5.1 (Claude Code)
---
M be/src/exprs/is-null-predicate-ir.cc
M fe/src/main/java/org/apache/impala/analysis/IsNullPredicate.java
M fe/src/main/java/org/apache/impala/analysis/TupleIsNullPredicate.java
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
M testdata/workloads/functional-query/queries/QueryTest/iceberg-v3-variant.test
6 files changed, 105 insertions(+), 16 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/81/24881/1
--
To view, visit http://gerrit.cloudera.org:8080/24881
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0b17821f6c8a988abf93494b7dbeb8f6f7db216
Gerrit-Change-Number: 24881
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>

Reply via email to