cloud-fan commented on a change in pull request #30893:
URL: https://github.com/apache/spark/pull/30893#discussion_r547727845



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala
##########
@@ -93,4 +93,26 @@ class ShowPartitionsSuite extends ShowPartitionsSuiteBase 
with CommandSuiteBase
       assert(sql("SHOW PARTITIONS part_datasrc").count() == 3)
     }
   }
+
+  test("null and empty string as partition values") {
+    import testImplicits._
+    withTable("t") {
+      val df = Seq(
+        (0, ""),
+        (1, null)
+      ).toDF("a", "part")
+      df.write
+        .partitionBy("part")
+        .format("parquet")
+        .mode(SaveMode.Overwrite)
+        .saveAsTable("t")
+
+      runShowPartitionsSql(
+        "SHOW PARTITIONS t",
+        Row("part=__HIVE_DEFAULT_PARTITION__") :: Nil)

Review comment:
       This is a bug... We shouldn't expose the internal stuff. We should 
return null as `df.show` did. Let's fix it later.




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