peter-toth commented on code in PR #44458:
URL: https://github.com/apache/spark/pull/44458#discussion_r1434886865
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/V1Writes.scala:
##########
@@ -102,8 +102,8 @@ object V1Writes extends Rule[LogicalPlan] with
SQLConfHelper {
val requiredOrdering = write.requiredOrdering.map(_.transform {
case a: Attribute => attrMap.getOrElse(a, a)
}.asInstanceOf[SortOrder])
- val outputOrdering = query.outputOrdering
- val orderingMatched = isOrderingMatched(requiredOrdering, outputOrdering)
+ val outputOrdering = empty2NullPlan.outputOrdering
+ val orderingMatched = isOrderingMatched(requiredOrdering.map(_.child),
outputOrdering)
Review Comment:
Good catch!
--
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]