gengliangwang commented on code in PR #36415:
URL: https://github.com/apache/spark/pull/36415#discussion_r866977451


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala:
##########
@@ -1035,6 +1060,41 @@ class PlanResolutionSuite extends AnalysisTest {
 
         case _ => fail("Expect UpdateTable, but got:\n" + parsed4.treeString)
       }
+
+      parsed5 match {
+        case UpdateTable(
+        AsDataSourceV2Relation(_),
+        Seq(Assignment(name: UnresolvedAttribute, 
UnresolvedAttribute(Seq("DEFAULT"))),
+        Assignment(age: UnresolvedAttribute, 
UnresolvedAttribute(Seq("DEFAULT")))),
+        None) =>
+          assert(name.name == "name")
+          assert(age.name == "age")
+
+        case _ => fail("Expect UpdateTable, but got:\n" + parsed5.treeString)
+      }
+
+      parsed6 match {
+        case UpdateTable(
+        AsDataSourceV2Relation(_),
+        Seq(Assignment(i: AttributeReference, AnsiCast(Literal(null, _), 
IntegerType, _)),

Review Comment:
   Hmm, probably I missed this in the previous reviews. So we will insert a 
NULL value for a default expression if the default column value is not defined, 
right?



##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala:
##########
@@ -1035,6 +1060,41 @@ class PlanResolutionSuite extends AnalysisTest {
 
         case _ => fail("Expect UpdateTable, but got:\n" + parsed4.treeString)
       }
+
+      parsed5 match {
+        case UpdateTable(
+        AsDataSourceV2Relation(_),

Review Comment:
   nit: indent



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to