Repository: spark
Updated Branches:
  refs/heads/master f6290aea2 -> 884d4f95f


[SPARK-21912][SQL][FOLLOW-UP] ORC/Parquet table should not create invalid 
column names

## What changes were proposed in this pull request?

During [SPARK-21912](https://issues.apache.org/jira/browse/SPARK-21912), we 
skipped testing 'ADD COLUMNS' on ORC tables due to ORC limitation. Since 
[SPARK-21929](https://issues.apache.org/jira/browse/SPARK-21929) is resolved 
now, we can test both `ORC` and `PARQUET` completely.

## How was this patch tested?

Pass the updated test case.

Author: Dongjoon Hyun <[email protected]>

Closes #19562 from dongjoon-hyun/SPARK-21912-2.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/884d4f95
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/884d4f95
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/884d4f95

Branch: refs/heads/master
Commit: 884d4f95f7ebfaa9d8c57cf770d10a2c6ab82d62
Parents: f6290ae
Author: Dongjoon Hyun <[email protected]>
Authored: Mon Oct 23 17:21:49 2017 -0700
Committer: gatorsmile <[email protected]>
Committed: Mon Oct 23 17:21:49 2017 -0700

----------------------------------------------------------------------
 .../apache/spark/sql/hive/execution/SQLQuerySuite.scala  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/884d4f95/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
index 1cf1c5c..39e918c 100644
--- 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
+++ 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
@@ -2031,8 +2031,8 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
 
   test("SPARK-21912 ORC/Parquet table should not create invalid column names") 
{
     Seq(" ", ",", ";", "{", "}", "(", ")", "\n", "\t", "=").foreach { name =>
-      withTable("t21912") {
-        Seq("ORC", "PARQUET").foreach { source =>
+      Seq("ORC", "PARQUET").foreach { source =>
+        withTable("t21912") {
           val m = intercept[AnalysisException] {
             sql(s"CREATE TABLE t21912(`col$name` INT) USING $source")
           }.getMessage
@@ -2049,15 +2049,12 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
             }.getMessage
             assert(m3.contains(s"contains invalid character(s)"))
           }
-        }
 
-        // TODO: After SPARK-21929, we need to check ORC, too.
-        Seq("PARQUET").foreach { source =>
           sql(s"CREATE TABLE t21912(`col` INT) USING $source")
-          val m = intercept[AnalysisException] {
+          val m4 = intercept[AnalysisException] {
             sql(s"ALTER TABLE t21912 ADD COLUMNS(`col$name` INT)")
           }.getMessage
-          assert(m.contains(s"contains invalid character(s)"))
+          assert(m4.contains(s"contains invalid character(s)"))
         }
       }
     }


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

Reply via email to