[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>
This commit is contained in:
Takeshi Yamamuro 2019-03-07 17:25:22 +09:00
parent a0e26cffc5
commit 315c95c399

View file

@ -1352,7 +1352,11 @@ object CodeGenerator extends Logging {
}
}.flatten
codeSizes.max
if (codeSizes.nonEmpty) {
codeSizes.max
} else {
0
}
}
/**