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



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowPartitionsSuite.scala
##########
@@ -17,6 +17,31 @@
 
 package org.apache.spark.sql.hive.execution.command
 
+import org.apache.spark.sql.{Row, SaveMode}
 import org.apache.spark.sql.execution.command.v1
 
-class ShowPartitionsSuite extends v1.ShowPartitionsSuiteBase with 
CommandSuiteBase
+class ShowPartitionsSuite extends v1.ShowPartitionsSuiteBase with 
CommandSuiteBase {
+  test("null and empty string as partition values") {

Review comment:
       It fails with NPE :-(
   
   ```scala
     test("null and empty string as partition values") {
       import testImplicits._
       withNamespaceAndTable("ns", "tbl") { t =>
         val df = Seq((0, ""), (1, null)).toDF("a", "part")
         df.write
           .partitionBy("part")
           .format("parquet")
           .mode(SaveMode.Overwrite)
           .saveAsTable(t)
   
         runShowPartitionsSql(s"SHOW PARTITIONS $t", Row("part=null") :: Nil)
       }
     }
   ```
   ```
   java.lang.NullPointerException was thrown.
   java.lang.NullPointerException
        at 
org.apache.spark.sql.execution.datasources.v2.ShowPartitionsExec.$anonfun$run$3(ShowPartitionsExec.scala:58)
        at 
scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
   ```
   Let me fix this separately since this PR is about tests. 




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