dongjoon-hyun commented on code in PR #55518:
URL: https://github.com/apache/spark/pull/55518#discussion_r3192409086
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteUpdateTable.scala:
##########
@@ -65,18 +72,15 @@ object RewriteUpdateTable extends RewriteRowLevelCommand {
assignments: Seq[Assignment],
cond: Expression): ReplaceData = {
- // resolve all required metadata attrs that may be used for grouping data
on write
- val metadataAttrs = resolveRequiredMetadataAttrs(relation,
operationTable.operation)
-
- // construct a read relation and include all required metadata columns
- val readRelation = buildRelationWithAttrs(relation, operationTable,
metadataAttrs)
+ val (readRelation, rowAttrs) = buildCoWReadSetup(relation, operationTable,
assignments, cond)
- // build a plan with updated and copied over records
- val query = buildReplaceDataUpdateProjection(readRelation, assignments,
cond)
+ val updatedAndRemainingRowsPlan = buildReplaceDataUpdateProjection(
+ readRelation, assignments, cond)
- // build a plan to replace read groups in the table
val writeRelation = relation.copy(table = operationTable)
- val projections = buildReplaceDataProjections(query, relation.output,
metadataAttrs)
+ val query = updatedAndRemainingRowsPlan
Review Comment:
This looks like duplications: Let's use one variable instead of mixing two
variables, `updatedAndRemainingRowsPlan` and `query`.
--
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]