kasakrisz commented on code in PR #3430:
URL: https://github.com/apache/hive/pull/3430#discussion_r924515510


##########
ql/src/test/results/clientpositive/llap/check_constraint.q.out:
##########
@@ -2519,23 +2519,23 @@ STAGE PLANS:
         Map 7 
             Map Operator Tree:
                 TableScan
-                  alias: t
+                  alias: tmerge

Review Comment:
   In the past the statement
   ```
   explain MERGE INTO tmerge as t using nonacid as s ON t.key = s.key
   WHEN MATCHED AND s.key < 5 THEN DELETE
   WHEN MATCHED AND s.key < 3 THEN UPDATE set a1 = '1'
   WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.a1, s.value)
   ```
   was rewritten to
   ```
   FROM
   `tmerge` `t`
     RIGHT OUTER JOIN
     `default`.`nonacid` `s`
     ON `t`.`key` = `s`.`key`
   <insert branches>
   ```
   In this patch I introduced a subquery because some of the target table 
columns needed twice in case of iceberg target and it is generated in the same 
way in case of updates.
   ```
   FROM
   (SELECT ROW__ID, `key`, `a1`, `value` FROM `default`.`tmerge`) `t`
     RIGHT OUTER JOIN
     `default`.`nonacid` `s`
     ON `t`.`key` = `s`.`key`
   <insert branches>
   ```
   In both the new and the old plan TS you highlighted scans the same table: 
tmerge
   But in the old plane `tmerge` and `t` refers to the same object. In the new 
plan the table does not have an alias so it is referenced by its name. The 
alias `t` refers the subquery.



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