Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ class EliminateSortsSuite extends PlanTest {
comparePlans(optimized, correctAnswer)
}

test("SPARK-32318: should not remove orderBy in distribute statement") {
val projectPlan = testRelation.select('a, 'b)
val orderByPlan = projectPlan.orderBy('b.desc)
val distributedPlan = orderByPlan.distribute('a)(1)
val optimized = Optimize.execute(distributedPlan.analyze)
val correctAnswer = distributedPlan.analyze
comparePlans(optimized, correctAnswer)
}

test("should not remove orderBy in left join clause if there is an outer limit") {
val projectPlan = testRelation.select('a, 'b)
val orderByPlan = projectPlan.orderBy('a.asc, 'b.desc)
Expand Down