Skip to content

Commit c3b59c6

Browse files
committed
[SPARK-29221][SQL] LocalTableScanExec: handle the case rows is "null" due to @transient
1 parent b8b67ae commit c3b59c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ case class LocalTableScanExec(
3737
"numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output rows"))
3838

3939
@transient private lazy val unsafeRows: Array[InternalRow] = {
40-
if (rows.isEmpty) {
40+
if (rows == null || rows.isEmpty) {
4141
Array.empty
4242
} else {
4343
val proj = UnsafeProjection.create(output, output)
@@ -59,7 +59,9 @@ case class LocalTableScanExec(
5959
}
6060

6161
override protected def stringArgs: Iterator[Any] = {
62-
if (rows.isEmpty) {
62+
if (rows == null) {
63+
Iterator("<unknown>", output)
64+
} else if (rows.isEmpty) {
6365
Iterator("<empty>", output)
6466
} else {
6567
Iterator(output)

0 commit comments

Comments
 (0)