iffyio commented on code in PR #2101:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2101#discussion_r2560588866


##########
src/dialect/mod.rs:
##########
@@ -601,13 +601,122 @@ pub trait Dialect: Debug + Any {
         false
     }
 
-    /// Return true if the dialect supports specifying multiple options
+    /// Returns true if the dialect supports specifying multiple options
     /// in a `CREATE TABLE` statement for the structure of the new table. For 
example:
     /// `CREATE TABLE t (a INT, b INT) AS SELECT 1 AS b, 2 AS a`
     fn supports_create_table_multi_schema_info_sources(&self) -> bool {
         false
     }
 
+    /// Returns `true` if the dialect supports qualified column names
+    /// as part of a MERGE's INSERT's column list. Example:
+    ///
+    /// ```sql
+    /// MERGE INTO FOO
+    /// USING FOO_IMP
+    ///    ON (FOO.ID = FOO_IMP.ID)
+    ///  WHEN NOT MATCHED THEN
+    ///      -- no qualifier
+    ///      INSERT (ID, NAME)
+    ///      VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
+    /// ```
+    /// vs.
+    /// ```sql
+    /// MERGE INTO FOO
+    /// USING FOO_IMP
+    ///    ON (FOO.ID = FOO_IMP.ID)
+    ///  WHEN NOT MATCHED THEN
+    ///      -- here: qualified
+    ///      INSERT (FOO.ID, FOO.NAME)
+    ///      VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
+    /// ```
+    /// or
+    /// ```sql
+    /// MERGE INTO FOO X
+    /// USING FOO_IMP
+    ///    ON (X.ID = FOO_IMP.ID)
+    ///  WHEN NOT MATCHED THEN
+    ///      -- here: qualified using the alias
+    ///      INSERT (X.ID, X.NAME)
+    ///      VALUES (FOO_IMP.ID, UPPER(FOO_IMP.NAME))
+    /// ```
+    ///
+    /// Note: in the latter case, the qualifier must match the target table
+    /// name or its alias if one is present. The parser will enforce this.
+    ///
+    /// The default implementation always returns `false` not allowing the
+    /// qualifiers.
+    fn supports_merge_insert_qualified_columns(&self) -> bool {
+        false
+    }
+
+    /// Returns `true` if the dialect supports specify an INSERT predicate in

Review Comment:
   Ah I mean effectively to assume the behavior is supported on all dialects, 
the parser will be permissive and accept the predicate syntax without 
consulting the configured dialect. Its similar to the qualified identifier 
scenario in that we try to let the parser be permissive where possible even 
though it implies that it will accept syntax that is technically not allowed 
for the dialect (downstream crates may perform additional validation if 
required)



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