eatoncys commented on a change in pull request #23010: [SPARK-26012][SQL]Null 
and '' values should not cause dynamic partition failure of string types
URL: https://github.com/apache/spark/pull/23010#discussion_r248152216
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala
 ##########
 @@ -44,4 +44,13 @@ class FileFormatWriterSuite extends QueryTest with 
SharedSQLContext {
       checkAnswer(spark.table("t4"), Row(0, 0))
     }
   }
+
+  test("Null and '' values should not cause dynamic partition failure of 
string types") {
+    withTable("t1", "t2") {
+      spark.range(3).write.saveAsTable("t1")
+      spark.sql("select id, cast(case when id = 1 then '' else null end as 
string) as p" +
+        " from t1").write.partitionBy("p").saveAsTable("t2")
+      checkAnswer(spark.table("t2").sort("id"), Seq(Row(0, null), Row(1, 
null), Row(2, null)))
+    }
+  }
 
 Review comment:
   Ok, modified, thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to