finchxxia opened a new pull request, #2325:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2325

   Add parsing support for the Databricks star shorthand syntax in MERGE 
statements, allowing `UPDATE SET *` and `INSERT *` to reference all columns 
from the source.
   
   ## Syntax
   
   ```
   [ common_table_expression ]
     MERGE [ WITH SCHEMA EVOLUTION ] INTO target_table_name [target_alias]
        USING source_table_reference [source_alias]
        ON merge_condition
        { WHEN MATCHED [ AND matched_condition ] THEN matched_action |
          WHEN NOT MATCHED [BY TARGET] [ AND not_matched_condition ] THEN 
not_matched_action |
          WHEN NOT MATCHED BY SOURCE [ AND not_matched_by_source_condition ] 
THEN not_matched_by_source_action } [...]
   
   matched_action
    { DELETE |
      UPDATE SET * |
      UPDATE SET { column = { expr | DEFAULT } } [, ...] }
   
   not_matched_action
    { INSERT * |
      INSERT (column1 [, ...] ) VALUES ( expr | DEFAULT ] [, ...] )
   
   not_matched_by_source_action
    { DELETE |
      UPDATE SET { column = { expr | DEFAULT } } [, ...] }
   ```
   
   ## Changes
   - Add `MergeUpdateKind` enum (`Set(Vec<Assignment>)` | `Star`) to replace 
the previous `assignments` field on `MergeUpdateExpr`, enforcing valid states 
at the type level
   - Add `MergeInsertKind::Star` variant for `INSERT *` shorthand
   - Add `supports_merge_star_syntax()` dialect method for Databricks and 
Generic


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