[ 
https://issues.apache.org/jira/browse/IMPALA-15203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119552#comment-18119552
 ] 

ASF subversion and git services commented on IMPALA-15203:
----------------------------------------------------------

Commit ada9dbf7bca2445a10b3797154fd78c40d4548f3 in impala's branch 
refs/heads/master from Arnab Karmakar
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=ada9dbf7b ]

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 skips UUID columns via
ignoreColumn() 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 inline
  intermediate StringVal ptr to the current tuple slot, even when NULL.
  This applies to TYPE_CHAR, TYPE_FIXED_UDA_INTERMEDIATE, and TYPE_UUID,
  preventing stale pointer writes in the interpreted aggregate path.
- BE: Exclude UUID from codegen optimizations that assume numeric
  MIN/MAX semantics (default-value initialization and null-bit
  shortcuts).
- BE: Enable hash-table codegen for TYPE_UUID.
- FE: Enable aggif, case, decode builtins for UUID.
- FE: Skip UUID columns in COMPUTE STATS via ignoreColumn() and allow
  column whitelists that exclude UUID columns.

Testing:
- Testdata: Add iceberg_uuid_test to functional_schema_template.sql so
  the table is available for ad-hoc 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)
Reviewed-on: http://gerrit.cloudera.org:8080/24871
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Add UUID aggregate function support
> -----------------------------------
>
>                 Key: IMPALA-15203
>                 URL: https://issues.apache.org/jira/browse/IMPALA-15203
>             Project: IMPALA
>          Issue Type: Sub-task
>            Reporter: Arnab Karmakar
>            Assignee: Arnab Karmakar
>            Priority: Major
>
> Register and implement {{{}COUNT{}}}/{{{}MIN{}}}/{{{}MAX{}}} (and related 
> GROUP BY paths) for UUID columns.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to