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


Change subject: IMPALA-15141 (part 1): Keep codegen enabled for queries on 
VARIANT
......................................................................

IMPALA-15141 (part 1): Keep codegen enabled for queries on VARIANT

The planner set the query-wide disable_codegen_hint for every query
that scans a VARIANT column, so these queries lost codegen in all of
their fragments, even in operators that never touch VARIANT values.
This patch removes the hint and makes the backend safe without it.
Expressions that involve VARIANT are still interpreted.

The hint also protected codegen paths that cannot deal with VARIANT:
* Exec nodes call ScalarExpr::GetCodegendComputeFn() directly (e.g.
  for conjuncts, hash/sort keys and partition exprs), bypassing
  ShouldCodegen(). GetCodegendComputeFn() now returns an expected
  error for expressions that involve VARIANT, so these callers fall
  back to interpretation, but only for the given operator.
* The Avro and text/sequence scanners codegen the materialization of
  the scan tuple based on its LLVM struct. They now fall back if the
  tuple has a VARIANT slot. Iceberg tables with a VARIANT column can
  have Avro data files. Queries on them still fail with a schema
  mismatch error, but impalad does not crash during codegen.
* LlvmCodeGen::GetSlotType() now knows the layout of VARIANT slots
  (two StringValues), so TupleDescriptor::GetLlvmStruct() works for
  tuples that have a VARIANT slot.

Tuple::CodegenMaterializeExprs() still falls back if the destination
tuple has a VARIANT slot (TOP-N, UNION ALL).

Testing:
* added e2e tests to check that the planner does not disable codegen
* the existing VARIANT e2e tests now run with codegen in half of
  their test vectors

Change-Id: I6e3c59cc41bab7421e0dd450e08944ffc3889241
Assisted-by: Claude Fable 5.1 (Claude Code)
---
M be/src/codegen/llvm-codegen.cc
M be/src/exec/avro/hdfs-avro-scanner.cc
M be/src/exec/hdfs-scanner.cc
M be/src/exprs/scalar-expr.cc
M be/src/runtime/tuple.cc
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-v3-variant-get.test
7 files changed, 47 insertions(+), 10 deletions(-)



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

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

Reply via email to