MaxGekk commented on a change in pull request #27530: [SPARK-30780][SQL] Empty
LocalTableScan should use RDD without partitions
URL: https://github.com/apache/spark/pull/27530#discussion_r377544690
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/LocalTableScanExec.scala
##########
@@ -45,10 +45,14 @@ case class LocalTableScanExec(
}
}
- private lazy val numParallelism: Int = math.min(math.max(unsafeRows.length,
1),
- sqlContext.sparkContext.defaultParallelism)
-
- private lazy val rdd = sqlContext.sparkContext.parallelize(unsafeRows,
numParallelism)
+ @transient private lazy val rdd: RDD[InternalRow] = {
+ if (rows.isEmpty) {
Review comment:
Maybe, `unsafeRows.isEmpty`? Otherwise I have to look at the difference
between `unsafeRows` and `rows`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]