-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24242][SQL] RangeExec should have correct outputOrdering and outputPartitioning #21291
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 2 commits
30b42d5
86c800c
6039094
015e2ad
3a14bd6
59499ad
f93738b
4bcac26
b317777
f41fc14
14a3402
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 |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ import org.apache.spark.sql.{execution, Row} | |
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.catalyst.expressions._ | ||
| import org.apache.spark.sql.catalyst.plans.{Cross, FullOuter, Inner, LeftOuter, RightOuter} | ||
| import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Repartition, Sort} | ||
| import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Range, Repartition, Sort} | ||
| import org.apache.spark.sql.catalyst.plans.physical._ | ||
| import org.apache.spark.sql.execution.columnar.InMemoryRelation | ||
| import org.apache.spark.sql.execution.exchange.{EnsureRequirements, ReusedExchangeExec, ReuseExchange, ShuffleExchangeExec} | ||
|
|
@@ -621,6 +621,17 @@ class PlannerSuite extends SharedSQLContext { | |
| requiredOrdering = Seq(orderingA, orderingB), | ||
| shouldHaveSort = true) | ||
| } | ||
|
|
||
| test("SPARK-24242: RangeExec should have correct output ordering") { | ||
|
||
| val df = spark.range(10).orderBy("id") | ||
|
||
| val rangeExec = df.queryExecution.executedPlan.collect { | ||
| case r: RangeExec => r | ||
| } | ||
| val range = df.queryExecution.optimizedPlan.collect { | ||
| case r: Range => r | ||
| } | ||
| assert(rangeExec.head.outputOrdering == range.head.outputOrdering) | ||
| } | ||
| } | ||
|
|
||
| // 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.
since we are here, shall we also implement
outputPartitioning?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.
ok.