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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2ScanExecBase.scala:
##########
@@ -124,28 +124,24 @@ trait DataSourceV2ScanExecBase extends LeafExecNode {
       inputPartitions: Seq[InputPartition]): Option[Seq[(InternalRow, 
Seq[InputPartition])]] = {
     if (!SQLConf.get.v2BucketingEnabled) return None
     keyGroupedPartitioning.flatMap { expressions =>
-      val results = inputPartitions.takeWhile {
-        case _: HasPartitionKey => true
-        case _ => false
-      }.map(p => (p.asInstanceOf[HasPartitionKey].partitionKey(), p))
-
-      if (results.length != inputPartitions.length || inputPartitions.isEmpty) 
{
+      if (inputPartitions.isEmpty || 
inputPartitions.count(!_.isInstanceOf[HasPartitionKey]) > 0) {

Review Comment:
   @sunchao Thanks, I revert these changes



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