Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24982 )

Change subject: IMPALA-15459: Add Iceberg-encoded theta sketch flavor for 
Puffin NDV stats
......................................................................


Patch Set 2:

(4 comments)

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

http://gerrit.cloudera.org:8080/#/c/24982/2//COMMIT_MSG@22
PS2, Line 22:  internal-only
Is this actually hidden from the users? The test suggest to me that it isn't.


http://gerrit.cloudera.org:8080/#/c/24982/2/be/src/exprs/aggregate-functions-ir.cc
File be/src/exprs/aggregate-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/24982/2/be/src/exprs/aggregate-functions-ir.cc@2799
PS2, Line 2799:   DCHECK(!dst->is_null);
              :   DCHECK_EQ(dst->len, sizeof(agg_state));
              :   auto agg_state_ptr = reinterpret_cast<agg_state*>(dst->ptr);
              :   DCHECK_EQ(agg_state_ptr->first, agg_phase::UPDATE);
              :   auto sketch_ptr =
              :       
reinterpret_cast<datasketches::update_theta_sketch*>(agg_state_ptr->second);
              :   int32_t val = src.val;
              :   sketch_ptr->update(&val, sizeof(val));
nit: create a helper that does most of this? Besides the type (int32 here) and 
how to get the value it always seems to be the same


http://gerrit.cloudera.org:8080/#/c/24982/2/fe/src/main/java/org/apache/impala/catalog/BuiltinsDb.java
File fe/src/main/java/org/apache/impala/catalog/BuiltinsDb.java:

http://gerrit.cloudera.org:8080/#/c/24982/2/fe/src/main/java/org/apache/impala/catalog/BuiltinsDb.java@459
PS2, Line 459:   // Update symbols for the internal Iceberg (Appendix D) theta 
flavor used by
nit: comments are bit verbose
The details could be written down at one place, for example at 
AggregateFunctions::DsThetaUpdateIceberg, and others could refer to it


http://gerrit.cloudera.org:8080/#/c/24982/2/testdata/workloads/functional-query/queries/QueryTest/datasketches-theta.test
File 
testdata/workloads/functional-query/queries/QueryTest/datasketches-theta.test:

http://gerrit.cloudera.org:8080/#/c/24982/2/testdata/workloads/functional-query/queries/QueryTest/datasketches-theta.test@622
PS2, Line 622:     ds_theta_estimate(ds_theta_exclude(d_int, d_bigint)),
             :     ds_theta_estimate(ds_theta_exclude(i_int, i_bigint))
Add same check for other types?
Btw is it really needed to create a table for this? We could collect the sketch 
and check estimates in one query.



--
To view, visit http://gerrit.cloudera.org:8080/24982
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I78c76c38dffa9807eb13ad465afab0b80f31984a
Gerrit-Change-Number: 24982
Gerrit-PatchSet: 2
Gerrit-Owner: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Mihaly Szjatinya <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Comment-Date: Mon, 12 Oct 2026 15:42:39 +0000
Gerrit-HasComments: Yes

Reply via email to