Skip to content

Commit 59b0606

Browse files
committed
[SPARK-10999] [SQL] Coalesce should be able to handle UnsafeRow
Author: Cheng Lian <[email protected]> Closes #9024 from liancheng/spark-10999.coalesce-unsafe-row-handling.
1 parent 60150cf commit 59b0606

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,15 @@
1717

1818
package org.apache.spark.sql.execution
1919

20-
import java.util.Random
21-
2220
import org.apache.spark.annotation.DeveloperApi
2321
import org.apache.spark.rdd.{PartitionwiseSampledRDD, RDD, ShuffledRDD}
24-
import org.apache.spark.serializer.Serializer
2522
import org.apache.spark.shuffle.sort.SortShuffleManager
26-
import org.apache.spark.sql.Row
2723
import org.apache.spark.sql.catalyst.InternalRow
28-
import org.apache.spark.sql.catalyst.CatalystTypeConverters
2924
import org.apache.spark.sql.catalyst.expressions._
3025
import org.apache.spark.sql.catalyst.plans.physical._
3126
import org.apache.spark.sql.execution.metric.SQLMetrics
32-
import org.apache.spark.util.random.PoissonSampler
3327
import org.apache.spark.util.MutablePair
28+
import org.apache.spark.util.random.PoissonSampler
3429
import org.apache.spark.{HashPartitioner, SparkEnv}
3530

3631
/**
@@ -294,6 +289,8 @@ case class Coalesce(numPartitions: Int, child: SparkPlan) extends UnaryNode {
294289
protected override def doExecute(): RDD[InternalRow] = {
295290
child.execute().map(_.copy()).coalesce(numPartitions, shuffle = false)
296291
}
292+
293+
override def canProcessUnsafeRows: Boolean = true
297294
}
298295

299296
/**

0 commit comments

Comments
 (0)