MaxGekk commented on a change in pull request #30398:
URL: https://github.com/apache/spark/pull/30398#discussion_r528207488



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala
##########
@@ -26,104 +26,42 @@ import org.apache.spark.sql.test.SharedSparkSession
 trait ShowPartitionsSuiteBase extends command.ShowPartitionsSuiteBase {
   override def version: String = "V1"
   override def catalog: String = CatalogManager.SESSION_CATALOG_NAME
-  override def defaultNamespace: Seq[String] = Seq("default")
   override def defaultUsing: String = "USING parquet"
 
-  private def createDateTable(table: String): Unit = {
-    sql(s"""
-      |CREATE TABLE $table (price int, qty int, year int, month int)
-      |$defaultUsing
-      |partitioned by (year, month)""".stripMargin)
-    sql(s"INSERT INTO $table PARTITION(year = 2015, month = 1) SELECT 1, 1")
-    sql(s"INSERT INTO $table PARTITION(year = 2015, month = 2) SELECT 2, 2")
-    sql(s"INSERT INTO $table PARTITION(year = 2016, month = 2) SELECT 3, 3")
-    sql(s"INSERT INTO $table PARTITION(year = 2016, month = 3) SELECT 3, 3")
+  override protected def wrongPartitionColumnsError(columns: String*): String 
= {
+    s"Non-partitioning column(s) ${columns.mkString("[", ", ", "]")} are 
specified"
   }
 
-  test("show everything") {
+  test("show everything in the default database") {
     val table = "dateTable"
     withTable(table) {
       createDateTable(table)
-      checkAnswer(
-        sql(s"show partitions $table"),
+      runShowPartitionsSql(
+        s"show partitions default.$table",
         Row("year=2015/month=1") ::
-          Row("year=2015/month=2") ::
-          Row("year=2016/month=2") ::
-          Row("year=2016/month=3") :: Nil)
-
-      checkAnswer(
-        sql(s"show partitions default.$table"),
-        Row("year=2015/month=1") ::
-          Row("year=2015/month=2") ::
-          Row("year=2016/month=2") ::
-          Row("year=2016/month=3") :: Nil)
+        Row("year=2015/month=2") ::
+        Row("year=2016/month=2") ::
+        Row("year=2016/month=3") :: Nil)
     }
   }
 
   test("filter by partitions") {
     val table = "dateTable"
     withTable(table) {
       createDateTable(table)
-      checkAnswer(
-        sql(s"show partitions default.$table PARTITION(year=2015)"),
+      runShowPartitionsSql(
+        s"show partitions default.$table PARTITION(year=2015)",
         Row("year=2015/month=1") ::
-          Row("year=2015/month=2") :: Nil)
-      checkAnswer(
-        sql(s"show partitions default.$table PARTITION(year=2015, month=1)"),
-        Row("year=2015/month=1") :: Nil)
-      checkAnswer(
-        sql(s"show partitions default.$table PARTITION(month=2)"),
+        Row("year=2015/month=2") :: Nil)
+      runShowPartitionsSql(
+        s"show partitions default.$table PARTITION(month=2)",

Review comment:
       To pass this check in V2, I need 
https://github.com/apache/spark/pull/30452




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

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