This is an automated email from the ASF dual-hosted git repository.

yamamuro pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new f7ad4ff  [SPARK-25863][SPARK-21871][SQL] Check if code size statistics 
is empty or not in updateAndGetCompilationStats
f7ad4ff is described below

commit f7ad4ff040d39c7a55a9e01a990534e55c8178a5
Author: Takeshi Yamamuro <yamam...@apache.org>
AuthorDate: Thu Mar 7 17:25:22 2019 +0900

    [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 <yamam...@apache.org>
    Signed-off-by: Takeshi Yamamuro <yamam...@apache.org>
---
 .../spark/sql/catalyst/expressions/codegen/CodeGenerator.scala      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
index d5857e0..812877d 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
@@ -1351,7 +1351,11 @@ object CodeGenerator extends Logging {
       }
     }.flatten
 
-    codeSizes.max
+    if (codeSizes.nonEmpty) {
+      codeSizes.max
+    } else {
+      0
+    }
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to