HyukjinKwon commented on a change in pull request #35788:
URL: https://github.com/apache/spark/pull/35788#discussion_r823285199



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala
##########
@@ -286,4 +286,22 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils 
with TestHiveSingleto
       FsConstants.LOCAL_FS_URI, workingDir, new Path("kv1.txt"))
     assert(r === new Path(s"$workingDir/kv1.txt"))
   }
+
+  test("[SPARK-2222] keep the legacy output schema") {
+    Seq(true, false).foreach { keepLegacySchema =>
+      withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> 
keepLegacySchema.toString) {
+        withView("v1") {
+          spark.sql(s"CREATE VIEW v1 AS SELECT 1 AS id ")

Review comment:
       ```suggestion
             spark.sql("CREATE VIEW v1 AS SELECT 1 AS id ")
   ```

##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala
##########
@@ -286,4 +286,22 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils 
with TestHiveSingleto
       FsConstants.LOCAL_FS_URI, workingDir, new Path("kv1.txt"))
     assert(r === new Path(s"$workingDir/kv1.txt"))
   }
+
+  test("[SPARK-2222] keep the legacy output schema") {
+    Seq(true, false).foreach { keepLegacySchema =>
+      withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> 
keepLegacySchema.toString) {
+        withView("v1") {
+          spark.sql(s"CREATE VIEW v1 AS SELECT 1 AS id ")
+
+          val views = sql(s"SHOW VIEWS")

Review comment:
       ```suggestion
             val views = sql("SHOW VIEWS")
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to