You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "singhpk234 (via GitHub)" <gi...@apache.org> on 2026/05/02 02:27:12 UTC
Re: [PR] Spark: Support aggregate pushdown for identity partition column GROUP BY [iceberg]
singhpk234 commented on code in PR #16176:
URL: https://github.com/apache/iceberg/pull/16176#discussion_r3175913919
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java:
##########
@@ -186,6 +196,213 @@ public boolean pushAggregation(Aggregation aggregation) {
return true;
}
+ /**
+ * Push down aggregation with GROUP BY on identity partition columns. When all GROUP BY columns
+ * are identity partition fields, aggregates can be computed from file metadata grouped by
+ * partition values, avoiding reading any data files.
+ */
+ private boolean pushGroupByAggregation(
+ Aggregation aggregation, List<BoundAggregate<?, ?>> boundAggregates) {
+ PartitionSpec spec = table().spec();
+ Schema tableSchema = table().schema();
+
+ List<Integer> groupByPositions = Lists.newArrayList();
+ List<Types.NestedField> groupByFields = Lists.newArrayList();
+ if (!resolveGroupByPartitions(
+ aggregation, spec, tableSchema, groupByPositions, groupByFields)) {
+ return false;
+ }
+
+ Map<List<Object>, AggregateEvaluator> evaluatorsByPartition =
+ groupFilesByPartition(spec, groupByPositions, boundAggregates);
Review Comment:
i am not confident this is correct, plus we are just checking the recent partitioning, a table could comprise of lot of different partition spec files which evolved across snapshots
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org