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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 6a88924  [SPARK-32625][SQL] Log error message when falling back to 
interpreter mode
6a88924 is described below

commit 6a889248265b63b2df0249df1c552082f5ed721e
Author: Yuming Wang <[email protected]>
AuthorDate: Sat Aug 15 12:31:32 2020 -0700

    [SPARK-32625][SQL] Log error message when falling back to interpreter mode
    
    ### What changes were proposed in this pull request?
    
    This pr log the error message when falling back to interpreter mode.
    
    ### Why are the changes needed?
    
    Not all error messages are in `CodeGenerator`, such as:
    ```
    21:48:44.612 WARN org.apache.spark.sql.catalyst.expressions.Predicate: Expr 
codegen error and falling back to interpreter mode
    java.lang.IllegalArgumentException: Can not interpolate 
org.apache.spark.sql.types.Decimal into code block.
        at 
org.apache.spark.sql.catalyst.expressions.codegen.Block$BlockHelper$.$anonfun$code$1(javaCode.scala:240)
        at 
org.apache.spark.sql.catalyst.expressions.codegen.Block$BlockHelper$.$anonfun$code$1$adapted(javaCode.scala:236)
        at 
scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
        at 
scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manual test.
    
    Closes #29440 from wangyum/SPARK-32625.
    
    Authored-by: Yuming Wang <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit c280c7f529e2766dd7dd45270bde340c28b9d74b)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../catalyst/expressions/CodeGeneratorWithInterpretedFallback.scala  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CodeGeneratorWithInterpretedFallback.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CodeGeneratorWithInterpretedFallback.scala
index 07fa813..3b72194 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CodeGeneratorWithInterpretedFallback.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CodeGeneratorWithInterpretedFallback.scala
@@ -51,9 +51,8 @@ abstract class CodeGeneratorWithInterpretedFallback[IN, OUT] 
extends Logging {
         try {
           createCodeGeneratedObject(in)
         } catch {
-          case NonFatal(_) =>
-            // We should have already seen the error message in `CodeGenerator`
-            logWarning("Expr codegen error and falling back to interpreter 
mode")
+          case NonFatal(e) =>
+            logWarning("Expr codegen error and falling back to interpreter 
mode", e)
             createInterpretedObject(in)
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to