Skip to content

[SPARK-35703][SQL][FOLLOWUP] ValidateRequirements should check the co-partitioning requirement - #35225

Closed
cloud-fan wants to merge 3 commits into
apache:masterfrom
cloud-fan:follow
Closed

[SPARK-35703][SQL][FOLLOWUP] ValidateRequirements should check the co-partitioning requirement#35225
cloud-fan wants to merge 3 commits into
apache:masterfrom
cloud-fan:follow

Conversation

@cloud-fan

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This is a followup of #32875 . This PR updates ValidateRequirements to match the new change in the partitioning-distribution framework, and check the co-partitioning requirement for join nodes.

Why are the changes needed?

Fix bugs in ValidateRequirements

Does this PR introduce any user-facing change?

no

How was this patch tested?

a new test suite

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@cloud-fan

Copy link
Copy Markdown
ContributorAuthor

cc @sunchao@c21

@sunchaosunchao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks @cloud-fan !

val specs = children.map(_.outputPartitioning).zip(requiredChildDistributions).map {
case (p, d) => p.createShuffleSpec(d.asInstanceOf[ClusteredDistribution])
}
specs.tail.forall(_.isCompatibleWith(specs.head))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: maybe we can add a logDebug here too

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.

+1 for maintaining existing behavior.

testValidate(Seq(1, 2), Seq(1, 0), Seq(1, 0), 5, 5, false)
}

test("SMJ requirements not satisfied with unequal partition number") {

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.

It would be nice to test for HashPartitioning(1) and AllTuples. I remember we had quite some bugs with AllTuples before. But this comment is non-blocking.

c21
c21 approved these changes Jan 19, 2022

@c21c21 left a comment

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.

LGTM, thanks @cloud-fan!

@cloud-fan

Copy link
Copy Markdown
ContributorAuthor

thanks for the review, merging to master!

Sign up for freeto 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.

3 participants

@cloud-fan@sunchao@c21