ulysses-you commented on code in PR #38875:
URL: https://github.com/apache/spark/pull/38875#discussion_r1039123347


##########
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala:
##########
@@ -2313,6 +2313,33 @@ class InsertSuite extends DataSourceTest with 
SharedSparkSession {
       }
     }
   }
+
+  test("SPARK-40988: Test case for insert partition should verify value") {
+    val tableName = "partition_table"
+    withTable(tableName) {
+      sql(s"DROP TABLE IF EXISTS $tableName")
+      sql(s"CREATE TABLE $tableName (id INT, name STRING) USING PARQUET 
PARTITIONED BY (age INT)")
+
+      sql(s"INSERT INTO TABLE $tableName PARTITION(age=1) VALUES (1, 'ABC')")
+      checkAnswer(spark.table(s"$tableName"), Row(1, "ABC", 1))
+
+      checkError(
+        exception = intercept[SparkNumberFormatException] {
+          sql(s"INSERT INTO TABLE $tableName PARTITION(age='aaa') VALUES (1, 
'ABC')")

Review Comment:
   Seems this command would fail even before. I guess you want to test insert 
into hive table ?
   ```scala
   sql(s"CREATE TABLE $tableName (id INT, name STRING) STORED PARQUET 
PARTITIONED BY (age INT)")
   
   withSQLConf(HiveUtils.CONVERT_INSERTING_PARTITIONED_TABLE.key -> "false") {
     ...
   }
   ```



##########
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala:
##########
@@ -2313,6 +2313,33 @@ class InsertSuite extends DataSourceTest with 
SharedSparkSession {
       }
     }
   }
+
+  test("SPARK-40988: Test case for insert partition should verify value") {
+    val tableName = "partition_table"
+    withTable(tableName) {
+      sql(s"DROP TABLE IF EXISTS $tableName")

Review Comment:
   unnecessary



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

To unsubscribe, e-mail: [email protected]

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