Steve Carlin has posted comments on this change. ( http://gerrit.cloudera.org:8080/24017 )
Change subject: IMPALA-14484: Calcite planner: Add column stats to union slot descriptors ...................................................................... Patch Set 5: (1 comment) http://gerrit.cloudera.org:8080/#/c/24017/5/fe/src/main/java/org/apache/impala/analysis/SetOperationStmt.java File fe/src/main/java/org/apache/impala/analysis/SetOperationStmt.java: http://gerrit.cloudera.org:8080/#/c/24017/5/fe/src/main/java/org/apache/impala/analysis/SetOperationStmt.java@701 PS5, Line 701: for (int i = 0; i < resultExprsList.size(); ++i) { > nit: could clean these loops up with com.google.common.collect.Streams.zip I'm not sure how to do what you are saying with the "zip" The initial ColumnStats where (i == 0) is easy to extract and create in a separate streaming loop. Also, the (i == 0) portion for creating an empty HashSet for sourceColumns is easy. Is this what you meant by preallocation? As for zipping once that is done, this is where I'm a little uncertain... The end result has a list of ColumnStats for each column. Each ColumnStats object (i) is mutable and can change for each union node column (i). This includes the "hasNumDistinctValues". And the sourceColumns will also change with each union node column(i) iteration. I guess I'm not sure which 2 streams we're trying to zip together here, nor am I sure how to extract out from these nested loops. It seems that an iteration within the inner loop is dependent on the results of the previous iteration, and the sourceColumns also gets built based on how the ColumnStats is built (with having numDistinctValues set). I'm also a little worried now about changing this algorithm because this is kinda out of scope from the original change. -- To view, visit http://gerrit.cloudera.org:8080/24017 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia0585fafa45658dffffdbf6410b028f03304b6e9 Gerrit-Change-Number: 24017 Gerrit-PatchSet: 5 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Jason Fehr <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Comment-Date: Thu, 25 Jun 2026 22:58:56 +0000 Gerrit-HasComments: Yes
