You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/07/08 10:10:40 UTC
[GitHub] [spark] pan3793 commented on a diff in pull request #36995: [SPARK-39607][SQL][DSV2] Distribution and ordering support V2 function in writing
pan3793 commented on code in PR #36995:
URL: https://github.com/apache/spark/pull/36995#discussion_r916672796
##########
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)
case _ =>
query
}
+
+ def resolveTransformExpression(expr: Expression): Expression = expr.transform {
+ case TransformExpression(scalarFunc: ScalarFunction[_], arguments, Some(numBuckets)) =>
Review Comment:
`TransformExpression` is introduced in SPARK-37377(#35657), to check input partition compatibility in `V2ScanPartitioningAndOrdering`
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org