pan3793 commented on code in PR #36995:
URL: https://github.com/apache/spark/pull/36995#discussion_r906803737
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DistributionAndOrderingUtils.scala:
##########
@@ -53,16 +63,27 @@ object DistributionAndOrderingUtils {
query
}
- val ordering = toCatalystOrdering(write.requiredOrdering, query)
+ val ordering = toCatalystOrdering(write.requiredOrdering, query,
funCatalogOpt)
val queryWithDistributionAndOrdering = if (ordering.nonEmpty) {
- Sort(ordering, global = false, queryWithDistribution)
+ Sort(
+ ordering.map(ur =>
resolveTransformExpression(ur).asInstanceOf[SortOrder]),
+ global = false,
+ queryWithDistribution)
} else {
queryWithDistribution
}
- queryWithDistributionAndOrdering
+ // Apply typeCoercionRules
+ SimpleAnalyzer.execute(queryWithDistributionAndOrdering)
Review Comment:
It's a little bit hacky to re-run the analyzer in optimize phase, but it may
be the simplest way
--
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]