cloud-fan commented on a change in pull request #25626: [SPARK-28892][SQL] Add 
UPDATE support for DataSource V2
URL: https://github.com/apache/spark/pull/25626#discussion_r323096593
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
 ##########
 @@ -574,6 +574,21 @@ case class DeleteFromTable(
   override def children: Seq[LogicalPlan] = child :: Nil
 }
 
+/**
+ * Update the data of table that specified with the condition with the given 
updated values.
+ * NOTE: Considering nested fields, we let the type of `attrs` to be 
`Seq[Expression]` becuase
+ * nested fields may be resolved to objects of type like `GetStructField`. 
However, currently
+ * we only support top-level fields, in which case `attrs` is actually of type 
`Seq[Attribute]`.
+ */
+case class UpdateTable(
+    child: LogicalPlan,
+    attrs: Seq[Expression],
 
 Review comment:
   Note that, since we don't forbid nested fields at parser level, analyzer can 
resolve the column name to either `Attribute` or nested field `GetStructField`. 
We fail the query at planning time if nested fields are found. Hopefully we can 
get rid of this limitation in the future.
   
   If we change this to `Seq[Attribute]`, we must rely on type hack to hold 
`GetStructField` in `Seq[Attribute]`, which is too tricky.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to