wirybeaver commented on code in PR #24429:
URL: https://github.com/apache/datafusion/pull/24429#discussion_r4016549071
##########
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:
Good catch. I moved `target_qualifier` after `on` and `clauses` in
`110fd7494`. This preserves the existing derived `PartialOrd` comparison order
and uses the qualifier only when the prior fields compare 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]