File tree 1 file changed +9
-0
lines changed
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,15 @@ class EliminateSortsSuite extends PlanTest {
284
284
comparePlans(optimized, correctAnswer)
285
285
}
286
286
287
+ test(" SPARK-32318: should not remove orderBy in distribute statement" ) {
288
+ val projectPlan = testRelation.select(' a , ' b )
289
+ val orderByPlan = projectPlan.orderBy(' b .desc)
290
+ val distributedPlan = orderByPlan.distribute(' a )(1 )
291
+ val optimized = Optimize .execute(distributedPlan.analyze)
292
+ val correctAnswer = distributedPlan.analyze
293
+ comparePlans(optimized, correctAnswer)
294
+ }
295
+
287
296
test(" should not remove orderBy in left join clause if there is an outer limit" ) {
288
297
val projectPlan = testRelation.select(' a , ' b )
289
298
val orderByPlan = projectPlan.orderBy(' a .asc, ' b .desc)
You can’t perform that action at this time.
0 commit comments