cloud-fan commented on a change in pull request #31421:
URL: https://github.com/apache/spark/pull/31421#discussion_r568382197
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsSuiteBase.scala
##########
@@ -154,4 +154,15 @@ trait ShowPartitionsSuiteBase extends QueryTest with
DDLCommandTestUtils {
assert(partitions.first().getString(0) === "part=a")
}
}
+
+ test("SPARK-33591: null as string partition literal value 'null' after
setting legacy conf") {
+ withSQLConf(SQLConf.LEGACY_PARSE_NULL_PARTITION_SPEC_AS_STRING_LITERAL.key
-> "true") {
+ withNamespaceAndTable("ns", "tbl") { t =>
+ sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED
BY (p1)")
+ sql(s"INSERT INTO TABLE $t PARTITION (p1 = null) SELECT 0")
+ runShowPartitionsSql(s"SHOW PARTITIONS $t", Row("p1=null") :: Nil)
+ runShowPartitionsSql(s"SHOW PARTITIONS $t PARTITION (p1 = null)",
Row("p1=null") :: Nil)
Review comment:
how does this show the null string behavior? shall we just test a simple
table scan operation?
----------------------------------------------------------------
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]