You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2022/07/11 10:28:27 UTC
[spark] branch master updated: [SQL][MINOR] Move general char/varchar test to the base test suite
This is an automated email from the ASF dual-hosted git repository.
maxgekk 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 61233769ffa [SQL][MINOR] Move general char/varchar test to the base test suite
61233769ffa is described below
commit 61233769ffabbbed243bc8c65b7a788c04e57244
Author: Wenchen Fan <we...@databricks.com>
AuthorDate: Mon Jul 11 13:28:15 2022 +0300
[SQL][MINOR] Move general char/varchar test to the base test suite
### What changes were proposed in this pull request?
This is a followup of https://github.com/apache/spark/pull/32501 . It moves a general char/varchar test from file source suite to the base char/varchar suite, so that it will be verified in all table formats, including v2.
### Why are the changes needed?
improve test coverage
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
N/A
Closes #37152 from cloud-fan/minor.
Authored-by: Wenchen Fan <we...@databricks.com>
Signed-off-by: Max Gekk <ma...@gmail.com>
---
.../apache/spark/sql/CharVarcharTestSuite.scala | 25 +++++++++++-----------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala
index 978e3f8d36d..321a838f276 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala
@@ -672,6 +672,18 @@ trait CharVarcharTestSuite extends QueryTest with SQLTestUtils {
}
}
}
+
+ test("SPARK-35359: create table and insert data over length values") {
+ Seq("char", "varchar").foreach { typ =>
+ withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) {
+ withTable("t") {
+ sql(s"CREATE TABLE t (col $typ(2)) using $format")
+ sql("INSERT INTO t SELECT 'aaa'")
+ checkAnswer(sql("select * from t"), Row("aaa"))
+ }
+ }
+ }
+ }
}
// Some basic char/varchar tests which doesn't rely on table implementation.
@@ -799,7 +811,6 @@ class FileSourceCharVarcharTestSuite extends CharVarcharTestSuite with SharedSpa
withTable("t") {
sql("SELECT '12' as col").write.format(format).save(dir.toString)
sql(s"CREATE TABLE t (col $typ(2)) using $format LOCATION '$dir'")
- val df = sql("select * from t")
checkAnswer(sql("select * from t"), Row("12"))
}
}
@@ -818,18 +829,6 @@ class FileSourceCharVarcharTestSuite extends CharVarcharTestSuite with SharedSpa
}
}
- test("SPARK-35359: create table and insert data over length values") {
- Seq("char", "varchar").foreach { typ =>
- withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) {
- withTable("t") {
- sql(s"CREATE TABLE t (col $typ(2)) using $format")
- sql("INSERT INTO t SELECT 'aaa'")
- checkAnswer(sql("select * from t"), Row("aaa"))
- }
- }
- }
- }
-
test("alter table set location w/ fit length values") {
Seq("char", "varchar").foreach { typ =>
withTempPath { dir =>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org