sunchao commented on code in PR #42839:
URL: https://github.com/apache/spark/pull/42839#discussion_r1317833964
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2ScanExecBase.scala:
##########
@@ -143,17 +143,16 @@ trait DataSourceV2ScanExecBase extends LeafExecNode {
// also sort the input partitions according to their partition key
order. This ensures
// a canonical order from both sides of a bucketed join, for example.
val partitionDataTypes = expressions.map(_.dataType)
- val partitionOrdering: Ordering[(InternalRow, InputPartition)] = {
-
RowOrdering.createNaturalAscendingOrdering(partitionDataTypes).on(_._1)
- }
- val sortedKeyToPartitions = results.sorted(partitionOrdering)
- val groupedPartitions = sortedKeyToPartitions
+ val rowOrdering =
RowOrdering.createNaturalAscendingOrdering(partitionDataTypes)
+ val sortedKeyToPartitions = results.sorted(rowOrdering.on(_._1))
Review Comment:
Hmm this is the partition value -> input split mapping before the `groupBy`
though. It also need to be returned.
--
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]