Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

A followup of #23388 .

AggUtils.createAggregate is not the right place to normalize the grouping expressions, as final aggregate is also created by it. The grouping expressions of final aggregate should be attributes which refer to the grouping expressions in partial aggregate.

This PR moves the normalization to the caller side of AggUtils.

How was this patch tested?

existing tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A small refactor so that we can retain the alias when normalizing.

@cloud-fan
Copy link
Contributor Author

cc @gatorsmile @hvanhovell

@SparkQA
Copy link

SparkQA commented Jan 30, 2019

Test build #101872 has finished for PR 23692 at commit 6cebb6b.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor Author

retest this please

Copy link
Member

@viirya viirya Jan 30, 2019

Choose a reason for hiding this comment

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

Don't we need to remove it from AggUtils.createAggregate?

@SparkQA
Copy link

SparkQA commented Jan 30, 2019

Test build #101879 has finished for PR 23692 at commit 6cebb6b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 30, 2019

Test build #101886 has finished for PR 23692 at commit 5a2c7e6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

val stateVersion = conf.getConf(SQLConf.STREAMING_AGGREGATION_STATE_FORMAT_VERSION)

// Ideally this should be done in `NormalizeFloatingNumbers`, but we do it here because
// `groupingExpressions` is not extracted during logical phase.
Copy link
Member

Choose a reason for hiding this comment

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

This will be refactored after https://issues.apache.org/jira/browse/SPARK-25914?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea

@gatorsmile
Copy link
Member

gatorsmile commented Jan 31, 2019 via email

@cloud-fan
Copy link
Contributor Author

thanks, merging to master!

@cloud-fan cloud-fan closed this in 0e2c487 Jan 31, 2019
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…s for final aggregate

## What changes were proposed in this pull request?

A followup of apache#23388 .

`AggUtils.createAggregate` is not the right place to normalize the grouping expressions, as final aggregate is also created by it. The grouping expressions of final aggregate should be attributes which refer to the grouping expressions in partial aggregate.

This PR moves the normalization to the caller side of `AggUtils`.

## How was this patch tested?

existing tests

Closes apache#23692 from cloud-fan/follow.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants