You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/11 10:20:11 UTC
[GitHub] [spark] MaxGekk commented on a change in pull request #27530:
[SPARK-30780][SQL] Empty LocalTableScan should use RDD without partitions
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org