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



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandTestUtils.scala
##########
@@ -39,7 +39,9 @@ import org.apache.spark.sql.test.SQLTestUtils
  */
 trait DDLCommandTestUtils extends SQLTestUtils {
   // The version of the catalog under testing such as "V1", "V2", "Hive V1".
-  protected def version: String
+  protected def catalogVersion: String
+  // The version of the SQL command under testing such as "V1", "V2".
+  protected def commandVersion: String

Review comment:
       I am separating out `version` into `catalogVersion` and `commandVersion` 
to have a finer control of the message (for example, we need to have the `Hive 
V1` version, and there are commands like `SHOW NAMESPACES` with v1 catalog 
always with v2 command. )

##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowNamespacesSuite.scala
##########
@@ -38,15 +38,11 @@ trait ShowNamespacesSuiteBase extends 
command.ShowNamespacesSuiteBase {
     }.getMessage
     assert(errMsg.contains("Namespace 'dummy' not found"))
   }
-
-  test("SPARK-34359: keep the legacy output schema") {
-    withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> "true") {
-      assert(sql("SHOW NAMESPACES").schema.fieldNames.toSeq == 
Seq("databaseName"))
-    }
-  }
 }
 
 class ShowNamespacesSuite extends ShowNamespacesSuiteBase with 
CommandSuiteBase {
+  override def commandVersion: String = "V2" // There is only V2 variant of 
SHOW NAMESPACES.

Review comment:
       The test name will be as following now (to be explicit about the command 
version):
   ```
   SHOW NAMESPACES using V1 catalog V2 command: default namespace (3 seconds, 
691 milliseconds)
   ...
   SHOW NAMESPACES using V2 catalog V2 command: default namespace (84 
milliseconds)
   ```

##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesSuiteBase.scala
##########
@@ -128,4 +128,10 @@ trait ShowNamespacesSuiteBase extends QueryTest with 
DDLCommandTestUtils {
       spark.sessionState.catalogManager.reset()
     }
   }
+
+  test("SPARK-34359: keep the legacy output schema") {

Review comment:
       This test can be now run with v2 catalog, thus moved to a common place.




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