Skip to content

Aggregate Push Down Followup#6923

Merged
rdblue merged 5 commits intoapache:masterfrom
huaxingao:agg_followup
Feb 26, 2023
Merged

Aggregate Push Down Followup#6923
rdblue merged 5 commits intoapache:masterfrom
huaxingao:agg_followup

Conversation

@huaxingao
Copy link
Copy Markdown
Contributor

@huaxingao huaxingao commented Feb 23, 2023

Address aggregate push down follow up comments

@huaxingao huaxingao changed the title fix TestAggregatePushDown Aggregate Push Down Followup Feb 24, 2023
switch (op) {
case COUNT:
Count countAgg = (Count) aggregate;
assert (countAgg.column() instanceof NamedReference);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of like not having if/else blocks compared to the remaining SparkAggregates utility we kept. Shall we adapt the one we kept to match this one? We probably just need to return null instead of throwing an exception.

Also, I see the kept utility has a special condition for isDistinct(). Is that still needed? We don't have it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need the isDistinct(), because we don't want to push down count(distinct c)

@@ -32,10 +33,14 @@ class SparkLocalScan implements LocalScan {
private final StructType readSchema;
private final InternalRow[] rows;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Shall we group all vars together? There is an empty line before filters now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@Override
public String toString() {
return String.format(
"IcebergScan(table=%s, type=%s, filters=%s)",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about IcebergScan -> IcebergLocalScan to indicate it is a local scan?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks

expressions.add((BoundAggregate<?, ?>) bound);
} else {
LOG.info(
"Skipping aggregate pushdown: AggregateFunc {} can't be converted to iceberg Expression",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: to iceberg Expression -> to Iceberg expression or simply to Iceberg.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@huaxingao
Copy link
Copy Markdown
Contributor Author

cc @aokolnychyi @rdblue

@aokolnychyi
Copy link
Copy Markdown
Contributor

Thanks, @huaxingao!

Copy link
Copy Markdown
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me other than the use of assert. Once that's rolled back I think this is ready to go.

@rdblue rdblue merged commit ab63917 into apache:master Feb 26, 2023
@rdblue
Copy link
Copy Markdown
Contributor

rdblue commented Feb 26, 2023

Thanks, @huaxingao!

@huaxingao
Copy link
Copy Markdown
Contributor Author

Thank you all!

@huaxingao huaxingao deleted the agg_followup branch February 26, 2023 19:55
Fokko pushed a commit to Fokko/iceberg that referenced this pull request Feb 28, 2023
krvikash pushed a commit to krvikash/iceberg that referenced this pull request Mar 16, 2023
zhongyujiang added a commit to zhongyujiang/iceberg that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants