You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by yu...@apache.org on 2022/05/29 12:02:52 UTC
[spark] branch master updated: [SPARK-39265][SQL][FOLLOWUP] Fix test failure when SPARK_ANSI_SQL_MODE is enabled
This is an automated email from the ASF dual-hosted git repository.
yumwang 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 4fc6c436ddb [SPARK-39265][SQL][FOLLOWUP] Fix test failure when SPARK_ANSI_SQL_MODE is enabled
4fc6c436ddb is described below
commit 4fc6c436ddbe436e2f5043684d10ba44759bdda3
Author: Yuming Wang <yu...@ebay.com>
AuthorDate: Sun May 29 20:02:26 2022 +0800
[SPARK-39265][SQL][FOLLOWUP] Fix test failure when SPARK_ANSI_SQL_MODE is enabled
### What changes were proposed in this pull request?
Fix test failure when `SPARK_ANSI_SQL_MODE` is enabled:
```
2022-05-28T21:02:01.9025896Z - INSERT rows, ALTER TABLE ADD COLUMNS with DEFAULTs, then SELECT them *** FAILED *** (1 second, 260 milliseconds)
2022-05-28T21:02:01.9112619Z org.apache.spark.SparkNumberFormatException: [CAST_INVALID_INPUT] The value 'a' of the type "STRING" cannot be cast to "TINYINT" because it is malformed. Correct the value as per the syntax, or change its target type. To return NULL instead, use `try_cast`. If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error
```
### Why are the changes needed?
To make CI test pass when `SPARK_ANSI_SQL_MODE` is enabled.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
N/A
Closes #36713 from wangyum/SPARK-39265.
Authored-by: Yuming Wang <yu...@ebay.com>
Signed-off-by: Yuming Wang <yu...@ebay.com>
---
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
index 77837148303..c5313a642f9 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
@@ -1572,7 +1572,7 @@ class InsertSuite extends DataSourceTest with SharedSparkSession {
withTableT {
sql("alter table t add columns (" +
"s boolean default true, " +
- "t byte default cast('a' as byte), " +
+ "t byte default cast(null as byte), " +
"u short default cast(42 as short), " +
"v float default 0, " +
"w double default 0, " +
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org