Skip to content

Conversation

@c21
Copy link
Contributor

@c21 c21 commented Feb 15, 2022

What changes were proposed in this pull request?

This is a followup of #35419 (comment), to add unit test to harden the assumption of SS partitioning and distribution requirement:

  • Check the HashPartitioning.partitionIdExpression to be exactly expected format
  • Check all different kinds of Partitioning against StatefulOpClusteredDistribution.

Also add a minor comment for StatefulOpClusteredDistribution, as SinglePartition can also satisfy the distribution.

Why are the changes needed?

Document our assumption of SS in code as unit test.
So next time when we introduce intrusive code change, the unit test can save us by failing loudly.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

The added unit test itself.

@github-actions github-actions bot added the SQL label Feb 15, 2022
case x => fail(s"Unexpected partitionIdExpression $x for $hashPartitioning")
}

// Validate only HashPartitioning (and HashPartitioning in PartitioningCollection) can satisfy
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Covered all subclasses of Partitioning here, except DataSourcePartitioning, because DataSourcePartitioning is not accessible from this unit test.

@c21
Copy link
Contributor Author

c21 commented Feb 15, 2022

cc @cloud-fan, @sunchao, @viirya, @HyukjinKwon and @HeartSaVioR, thanks.

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

+1 Thanks for the addition of new test!

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

looks okay

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM too

Copy link
Contributor

@cloud-fan cloud-fan left a comment

Choose a reason for hiding this comment

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

LGTM

@HeartSaVioR
Copy link
Contributor

Thanks! Merging to master.

@c21
Copy link
Contributor Author

c21 commented Feb 15, 2022

Thank you all for review!

@c21 c21 deleted the partition-test branch February 15, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants