You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2022/08/05 09:32:58 UTC

[spark] branch branch-3.3 updated: [SPARK-39981][SQL] Throw the exception QueryExecutionErrors.castingCauseOverflowErrorInTableInsert in Cast

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

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


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 26f0d501595 [SPARK-39981][SQL] Throw the exception QueryExecutionErrors.castingCauseOverflowErrorInTableInsert in Cast
26f0d501595 is described below

commit 26f0d501595d4bddc7420e5c0505ccb1a9a991c4
Author: Hyukjin Kwon <gu...@apache.org>
AuthorDate: Fri Aug 5 18:31:46 2022 +0900

    [SPARK-39981][SQL] Throw the exception QueryExecutionErrors.castingCauseOverflowErrorInTableInsert in Cast
    
    This PR is a followup of https://github.com/apache/spark/pull/37283. It missed `throw` keyword in the interpreted path.
    
    To throw an exception as intended instead of returning an exception itself.
    
    Yes, it will throw an exception as expected in the interpreted path.
    
    Haven't tested because it's too much straightforward.
    
    Closes #37414 from HyukjinKwon/SPARK-39981.
    
    Authored-by: Hyukjin Kwon <gu...@apache.org>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
    (cherry picked from commit e6b9c6166a08ad4dca2550bbbb151fa575b730a8)
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 .../src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
index 014c2be7319..f5dbeda514a 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
@@ -2365,7 +2365,7 @@ case class CheckOverflowInTableInsert(child: AnsiCast, columnName: String) exten
     child.eval(input)
   } catch {
     case e: SparkArithmeticException =>
-      QueryExecutionErrors.castingCauseOverflowErrorInTableInsert(
+      throw QueryExecutionErrors.castingCauseOverflowErrorInTableInsert(
         child.child.dataType,
         child.dataType,
         columnName)


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