cloud-fan commented on a change in pull request #30421:
URL: https://github.com/apache/spark/pull/30421#discussion_r583469842
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
##########
@@ -2488,4 +2488,27 @@ class DDLParserSuite extends AnalysisTest {
testCreateOrReplaceDdl(sql, expectedTableSpec, expectedIfNotExists = false)
}
+
+ test("SPARK-33474: Support TypeConstructed partition spec value") {
+ def insertPartitionPlan(part: String): InsertIntoStatement = {
+ InsertIntoStatement(
+ UnresolvedRelation(Seq("t")),
+ Map("part" -> Some(part)),
+ Seq.empty[String],
+ UnresolvedInlineTable(Seq("col1"), Seq(Seq(Literal("a")))),
+ overwrite = false, ifPartitionNotExists = false)
+ }
+
+ val dateTypeSql = "INSERT INTO t PARTITION(part = date'2019-01-02')
VALUES('a')"
+ val interval = new CalendarInterval(7, 1, 1000).toString
+ val intervalTypeSql = s"INSERT INTO t PARTITION(part =
interval'$interval') VALUES('a')"
+ val timestamp = "2019-01-02 11:11:11"
+ val timestampTypeSql = s"INSERT INTO t PARTITION(part =
timestamp'$timestamp') VALUES('a')"
+ val binaryTypeSql = s"INSERT INTO t PARTITION(part =
X'537061726B2053514C') VALUES('a')"
Review comment:
Can we generate the binary of `537061726B2053514C` instead of hardcode
it?
----------------------------------------------------------------
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]