Hello Zoltan Borok-Nagy, Impala Public Jenkins,

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

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

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

Change subject: IMPALA-15203: Add aggregate function support for UUID columns
......................................................................

IMPALA-15203: Add aggregate function support for UUID columns

This patch adds support for common aggregate functions on Iceberg UUID
columns, including COUNT, MIN, MAX, COUNT(DISTINCT), NDV, and
sampled_ndv. MIN/MAX comparisons use RFC 4122 byte ordering on the raw
16-byte representation. For approximate distinct counting (NDV and
sampled_ndv), UUID reuses the existing STRING HLL update functions
since both types cross the UDF boundary as StringVal and require the
same hashing behavior.

Additionally, this patch registers planner helper builtins (aggif, case,
decode, murmur_hash) needed for grouping sets and multi-class DISTINCT
aggregates over UUID columns. COMPUTE STATS is disabled for tables with
UUID columns until stats gathering is fully validated.

Key changes:
- BE: Implement MinUuid and MaxUuid aggregate update functions that
  compare raw 16-byte UUID values.
- BE: Add AggIfUpdateUuid/AggIfMergeUuid using inline intermediate slots.
- BE: Fix SetAnyVal in agg-fn-evaluator to always bind UUID intermediate
  ptr to current tuple slot, even when NULL (prevents stale pointer
  writes in interpreted path).
- BE: Exclude UUID from codegen optimizations that assume numeric
  MIN/MAX semantics (default-value initialization and null-bit
  shortcuts).
- FE: Enable aggif, case, decode builtins for UUID.
- FE: Reject COMPUTE STATS on UUID columns and allow column whitelists
  that exclude UUID columns.

Testing:
- Add positive test cases for MIN, MAX, COUNT, COUNT(DISTINCT),
  GROUP BY, NDV with precision, sampled_ndv, and HAVING clauses.
- Add tests for aggif/case/decode with grouping sets and multi-distinct
  aggregates.
- Test COMPUTE STATS rejection for table-level and UUID column, and
  positive case for non-UUID column whitelist.
- Retain negative tests confirming that SUM and AVG are correctly
  rejected at analysis time for UUID.

Change-Id: I2187495c8be5b95ecff3f458b6549916466e9c83
Assisted-by: Composer 2.5 (Cursor)
---
M be/src/codegen/codegen-anyval.cc
M be/src/exec/aggregator.cc
M be/src/exec/hash-table.cc
M be/src/exprs/agg-fn-evaluator.cc
M be/src/exprs/aggregate-functions-ir.cc
M be/src/exprs/aggregate-functions.h
M be/src/exprs/case-expr.cc
M common/function-registry/impala_functions.py
M fe/src/main/java/org/apache/impala/analysis/CaseExpr.java
M fe/src/main/java/org/apache/impala/analysis/ComputeStatsStmt.java
M fe/src/main/java/org/apache/impala/catalog/BuiltinsDb.java
A 
testdata/workloads/functional-query/queries/QueryTest/iceberg-uuid-aggregates.test
M testdata/workloads/functional-query/queries/QueryTest/iceberg-uuid-type.test
M tests/query_test/test_iceberg.py
14 files changed, 492 insertions(+), 96 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/71/24871/4
--
To view, visit http://gerrit.cloudera.org:8080/24871
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2187495c8be5b95ecff3f458b6549916466e9c83
Gerrit-Change-Number: 24871
Gerrit-PatchSet: 4
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to