yabola commented on code in PR #39687:
URL: https://github.com/apache/spark/pull/39687#discussion_r1089601759


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -132,11 +130,12 @@ case class BatchScanExec(
 
       outputPartitioning match {
         case p: KeyGroupedPartitioning =>
-          val partitionMapping = finalPartitions.map(s =>
-            s.head.asInstanceOf[HasPartitionKey].partitionKey() -> s).toMap
+          val partitionMapping = finalPartitions
+            .map(s => InternalRowComparableWrapper(s.head, p.expressions) -> 
s).toMap
           finalPartitions = p.partitionValues.map { partValue =>
             // Use empty partition for those partition values that are not 
present
-            partitionMapping.getOrElse(partValue, Seq.empty)

Review Comment:
   `Map` operation needs to rely on `equals` `hashCode` method, change to use 
`InternalRowComparableWrapper`



-- 
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]

Reply via email to