Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-32127

Check rules for MERGE INTO should use MergeAction.condition other than MergeAction.children

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1, 3.1.0
    • SQL
    • None

    Description

      SPARK-30924 adds some check rules for MERGE INTO one of which ensures the first MATCHED clause must have a condition. However, it uses MergeAction.children in the checking which is not accurate for the case, and it lets the below case pass the check:

      MERGE INTO testcat1.ns1.ns2.tbl AS target
      xxx
      WHEN MATCHED THEN UPDATE SET target.col2 = source.col2
      WHEN MATCHED THEN DELETE
      xxx
      

      We should use MergeAction.condition instead.

      Attachments

        Activity

          People

            xinxianyin Xianyin Xin
            xinxianyin Xianyin Xin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: