Skip to content

[MINOR]: Add a test case for when target partition is 1, no hash repartition is added to the plan.#8757

Merged
mustafasrepo merged 1 commit intoapache:mainfrom
synnada-ai:minor/target1_hash_repartition
Jan 5, 2024
Merged

[MINOR]: Add a test case for when target partition is 1, no hash repartition is added to the plan.#8757
mustafasrepo merged 1 commit intoapache:mainfrom
synnada-ai:minor/target1_hash_repartition

Conversation

@mustafasrepo
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions Bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jan 5, 2024
) -> Result<DistributionContext> {
let partition_count = input.plan.output_partitioning().partition_count();
// Early return if hash repartition is unnecessary
if n_target == partition_count && n_target == 1 {
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.

I think previous check was wrong, partition count equality doesn't mean their hash requirement is satisfied. However, when target is 1 hash requirement is trivially satisfied

Copy link
Copy Markdown
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd appreciate a quick look by @Dandandan or @alamb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants