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_r248142075
##########
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:
Sorry, I don't quite understand what w/o CodeGen means. Would you like to
give an example, 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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]