hvanhovell 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_r377853444
########## 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: This way we avoid materializing the `unsafeRows` lazy val. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org