pan3793 commented on code in PR #35657:
URL: https://github.com/apache/spark/pull/35657#discussion_r815402315
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DistributionAndOrderingUtils.scala:
##########
@@ -30,10 +30,12 @@ object DistributionAndOrderingUtils {
def prepareQuery(write: Write, query: LogicalPlan, conf: SQLConf):
LogicalPlan = write match {
case write: RequiresDistributionAndOrdering =>
val numPartitions = write.requiredNumPartitions()
- val distribution = write.requiredDistribution match {
- case d: OrderedDistribution => d.ordering.map(e => toCatalyst(e,
query))
- case d: ClusteredDistribution => d.clustering.map(e => toCatalyst(e,
query))
- case _: UnspecifiedDistribution => Array.empty[Expression]
+ val distribution = toCatalystDistribution(write.requiredDistribution(),
query) match {
Review Comment:
Looks like it's close to support organizing data before writing by
repartition/sort by functions defined in `FunctionCatalog`?
--
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]