Skip to content

Commit dfde0c6

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 <yamamuro@apache.org> Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
1 parent 877b8db commit dfde0c6

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
@@ -1472,7 +1472,11 @@ object CodeGenerator extends Logging {
14721472
}
14731473
}.flatten
14741474

1475-
codeSizes.max
1475+
if (codeSizes.nonEmpty) {
1476+
codeSizes.max
1477+
} else {
1478+
0
1479+
}
14761480
}
14771481

14781482
/**

0 commit comments

Comments
 (0)