EnricoMi commented on PR #38358:
URL: https://github.com/apache/spark/pull/38358#issuecomment-1302512656
@zzzzming95 Your query is affected by this issue as well (Spark 3.3):
```
Sort [input[2, string, true] ASC NULLS FIRST], false, 0
+- Project [id#37, sort_col#38, empty2null(p#39) AS p#46]
+- AdaptiveSparkPlan isFinalPlan=false
+- Sort [p#39 ASC NULLS FIRST, sort_col#38 ASC NULLS FIRST], false, 0
+- Exchange RoundRobinPartitioning(10), REPARTITION_BY_NUM,
[plan_id=42]
+- LocalTableScan [id#37, sort_col#38, p#39]
```
The outer `Sort` will break the inner `Sort` when spills occur.
But you are right, the issue in #38356 is different and has been introduced
in Spark 3.4.
For completeness, this is how nullable string partition columns look like
after the fix (Spark 3.3):
```
Project [id#10, sort_col#11, empty2null(p#12) AS p#19]
+- *(1) Sort [p#12 ASC NULLS FIRST, sort_col#11 ASC NULLS FIRST], false, 0
+- ShuffleQueryStage 0
+- Exchange RoundRobinPartitioning(10), REPARTITION_BY_NUM,
[plan_id=12]
+- LocalTableScan [id#10, sort_col#11, p#12]
```
Btw., this is what I would expect from Spark 3.4 when #38356 is fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]