mihaibudiu commented on code in PR #4572:
URL: https://github.com/apache/calcite/pull/4572#discussion_r2446206698


##########
core/src/main/java/org/apache/calcite/rel/core/TableModify.java:
##########
@@ -55,7 +55,18 @@
  * <ul>
  * <li>For {@code INSERT}, those rows are the new values;
  * <li>for {@code DELETE}, the old values;
- * <li>for {@code UPDATE}, all old values plus updated new values.
+ * <li>for {@code UPDATE}, all old values plus updated new values;
+ * <li>for {@code MERGE}, the rows may contain fields for both {@code INSERT} 
and {@code UPDATE}

Review Comment:
   is this just adding missing documentation, or is it a new feature you are 
adding?
   if it's a new feature, it should probably be a separate JIRA case.
   if it's missing documentation is should probably stay in a separate commit.



##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -1810,6 +1814,69 @@ private boolean isWindowTableFunctionRex(RexNode rex) {
     };
   }
 
+  /**
+   * A context that uses a select list.
+   */
+  final class SelectListContext extends BaseContext {
+    private final boolean aliasRef;
+    private final SqlNodeList selectList;
+
+    SelectListContext(

Review Comment:
   I know you didn't write this class, but I can't quickly figure out what 
aliasRef means, if you know maybe you can add some JavaDoc.



##########
core/src/main/java/org/apache/calcite/sql/SqlMerge.java:
##########
@@ -148,10 +148,19 @@ public SqlNode getCondition() {
 
   /**
    * Gets the source SELECT expression for the data to be updated/inserted.
+   *
+   * <p>The source SELECT column order:
+   * <ul>
+   *   <li>`WHEN NOT MATCHED THEN INSERT` only: [new values...]</li>
+   *   <li>`WHEN MATCHED THEN UPDATE` only: [old table columns..., updated new 
values...]</li>
+   *   <li>Both `NOT MATCHED THEN INSERT` and `WHEN MATCHED THEN UPDATE`: 
[insert new values...,
+   *   old table columns..., updated new values...]</li>
+   * </ul>
    * Returns null before the statement has been expanded by
-   * {@link SqlValidatorImpl#performUnconditionalRewrites(SqlNode, boolean)}.
+   * {@link SqlValidatorImpl#performUnconditionalRewrites(SqlNode, boolean)} 
and

Review Comment:
   do you mean "returns null if called before ... have been invoked?"



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

Reply via email to