Skip to content

Commit f7ad4ff

Browse files
committed
[SPARK-25863][SPARK-21871][SQL] Check if code size statistics is empty or not in updateAndGetCompilationStats
## What changes were proposed in this pull request? `CodeGenerator.updateAndGetCompilationStats` throws an unsupported exception for empty code size statistics. This pr added code to check if it is empty or not. ## How was this patch tested? Pass Jenkins. Closes #23947 from maropu/SPARK-21871-FOLLOWUP. Authored-by: Takeshi Yamamuro <[email protected]> Signed-off-by: Takeshi Yamamuro <[email protected]>
1 parent 9702915 commit f7ad4ff

File tree

1 file changed

+5
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+5
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,11 @@ object CodeGenerator extends Logging {
13511351
}
13521352
}.flatten
13531353

1354-
codeSizes.max
1354+
if (codeSizes.nonEmpty) {
1355+
codeSizes.max
1356+
} else {
1357+
0
1358+
}
13551359
}
13561360

13571361
/**

0 commit comments

Comments
 (0)