-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24495][SQL] EnsureRequirement returns wrong plan when reordering equal keys #21529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
06858cd
341f1b2
40abcff
6553c27
6ef4f0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -679,6 +679,17 @@ class PlannerSuite extends SharedSQLContext { | |
| } | ||
| assert(rangeExecInZeroPartition.head.outputPartitioning == UnknownPartitioning(0)) | ||
| } | ||
|
|
||
| test("SPARK-24495: EnsureRequirements can return wrong plan when reusing the same key in join") { | ||
| withSQLConf(("spark.sql.shuffle.partitions", "1"), | ||
|
||
| ("spark.sql.constraintPropagation.enabled", "false"), | ||
| ("spark.sql.autoBroadcastJoinThreshold", "-1")) { | ||
| val df1 = spark.range(100) | ||
|
||
| val df2 = spark.range(100).select(($"id" * 2).as("b1"), (- $"id").as("b2")) | ||
|
||
| val res = df1.join(df2, $"id" === $"b1" && $"id" === $"b2") | ||
| assert(res.collect().sameElements(Array(Row(0, 0, 0)))) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Used for unit-testing EnsureRequirements | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe
pickedIndexes?