You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2023/10/10 08:01:16 UTC
[spark] branch master updated: [SPARK-45473][SQL] Fix incorrect error message for RoundBase
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new d33644a9f8c [SPARK-45473][SQL] Fix incorrect error message for RoundBase
d33644a9f8c is described below
commit d33644a9f8cf0a1e18c920b04262b9ef99ef8b2d
Author: Liang-Chi Hsieh <vi...@gmail.com>
AuthorDate: Tue Oct 10 01:01:03 2023 -0700
[SPARK-45473][SQL] Fix incorrect error message for RoundBase
### What changes were proposed in this pull request?
This minor patch fixes incorrect error message of `RoundBase`.
### Why are the changes needed?
Fix incorrect error message.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Unit test
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #43302 from viirya/minor_fix.
Authored-by: Liang-Chi Hsieh <vi...@gmail.com>
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
.../org/apache/spark/sql/catalyst/expressions/mathExpressions.scala | 2 +-
.../spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
index e87d0bc4141..038e7ff5951 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
@@ -1509,7 +1509,7 @@ abstract class RoundBase(child: Expression, scale: Expression,
DataTypeMismatch(
errorSubClass = "NON_FOLDABLE_INPUT",
messageParameters = Map(
- "inputName" -> toSQLId("scala"),
+ "inputName" -> toSQLId("scale"),
"inputType" -> toSQLType(scale.dataType),
"inputExpr" -> toSQLExpr(scale)))
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala
index 73324c532a3..1137996a809 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala
@@ -602,7 +602,7 @@ class ExpressionTypeCheckingSuite extends SparkFunSuite with SQLHelper with Quer
errorClass = "DATATYPE_MISMATCH.NON_FOLDABLE_INPUT",
parameters = Map(
"sqlExpr" -> "\"round(intField, intField)\"",
- "inputName" -> "`scala`",
+ "inputName" -> "`scale`",
"inputType" -> "\"INT\"",
"inputExpr" -> "\"intField\""))
@@ -649,7 +649,7 @@ class ExpressionTypeCheckingSuite extends SparkFunSuite with SQLHelper with Quer
errorClass = "DATATYPE_MISMATCH.NON_FOLDABLE_INPUT",
parameters = Map(
"sqlExpr" -> "\"bround(intField, intField)\"",
- "inputName" -> "`scala`",
+ "inputName" -> "`scale`",
"inputType" -> "\"INT\"",
"inputExpr" -> "\"intField\""))
checkError(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org