imback82 commented on a change in pull request #34666:
URL: https://github.com/apache/spark/pull/34666#discussion_r753622693



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTblPropertiesSuiteBase.scala
##########
@@ -87,4 +88,25 @@ trait ShowTblPropertiesSuiteBase extends QueryTest with 
DDLCommandTestUtils {
       assert(res.head.getString(1).contains(s"does not have property: 
$nonExistingKey"))
     }
   }
+
+  test("KEEP THE LEGACY OUTPUT SCHEMA") {
+    Seq(true, false).foreach { keepLegacySchema =>
+      withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> 
keepLegacySchema.toString) {
+        withNamespaceAndTable("ns1", "tbl") { tbl =>
+          spark.sql(s"CREATE TABLE $tbl (id bigint, data string) $defaultUsing 
" +
+            s"TBLPROPERTIES ('user'='spark', 'status'='new')")

Review comment:
       nit: `s` not needed.

##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -401,15 +401,9 @@ class ResolveSessionCatalog(val catalogManager: 
CatalogManager)
           throw 
QueryCompilationErrors.externalCatalogNotSupportShowViewsError(resolved)
       }
 
-    case s @ ShowTableProperties(ResolvedV1TableOrViewIdentifier(ident), 
propertyKey, output) =>
-      val newOutput =
-        if (conf.getConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA) && 
propertyKey.isDefined) {
-          assert(output.length == 2)
-          output.tail
-        } else {
-          output
-        }
-      ShowTablePropertiesCommand(ident.asTableIdentifier, propertyKey, 
newOutput)
+    case s @ ShowTableProperties(ResolvedV1TableOrViewIdentifier(ident), 
propertyKey, output)
+      if conf.useV1Command =>
+        ShowTablePropertiesCommand(ident.asTableIdentifier, propertyKey, 
output)

Review comment:
       nit:
   ```suggestion
           if conf.useV1Command =>
         ShowTablePropertiesCommand(ident.asTableIdentifier, propertyKey, 
output)
   ```

##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTblPropertiesSuite.scala
##########
@@ -56,7 +44,7 @@ trait ShowTblPropertiesSuiteBase extends 
command.ShowTblPropertiesSuiteBase
     }
   }
 
-  test("SHOW TBLPROPERTIES FOR TEMPORARY IEW") {
+  testV1("SHOW TBLPROPERTIES FOR TEMPORARY IEW") {

Review comment:
       nit: IEW => VIEW




-- 
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