kumarUjjawal commented on code in PR #24429:
URL: https://github.com/apache/datafusion/pull/24429#discussion_r4012194071


##########
datafusion/expr/src/logical_plan/dml.rs:
##########
@@ -299,15 +311,71 @@ impl Display for InsertOp {
 }
 
 /// Describes a MERGE INTO operation's parameters.
+///
+/// [`Self::target_qualifier`] is the SQL-visible relation name used by
+/// expressions. The target's catalog/provider identity remains in
+/// [`DmlStatement::table_name`].
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash)]
+#[non_exhaustive]
 pub struct MergeIntoOp {
+    /// The target relation name visible to expressions in the MERGE scope.
+    target_qualifier: TableReference,
     /// The join condition from `ON <expr>`.
     pub on: Expr,
     /// The WHEN clauses, in the order they appeared in the SQL.
     pub clauses: Vec<MergeIntoClause>,
 }
 
 impl MergeIntoOp {
+    /// Create a MERGE operation.
+    pub fn new(
+        target_qualifier: impl Into<TableReference>,

Review Comment:
   Should we place `target_qualifier` after `on` and `clauses`?
   
   `MergeIntoOp` derives `PartialOrd`, which compares fields in declaration 
order. Placing the new field first makes the qualifier the primary comparison 
key. This silently changes the existing ordering behavior, and 
`cargo-semver-checks` reports it as `partial_ord_struct_fields_reordered`.
   
   Putting the new field last preserves the previous `on`-then-`clauses` 
comparison order while still including the qualifier when the existing fields 
are equal.



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