Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18801

MERGE INTO SQL not work fully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.2
    • None
    • Clients
    • None

    Description

      Here is three sql:

      1:

      MERGE INTO transactions AS T 
      USING merge_source AS S
      ON T.id = S.id
      WHEN MATCHED THEN UPDATE SET name='update' ;

      2:**

      MERGE INTO transactions AS T 
      USING merge_source AS S
      ON T.id = S.id
      WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');

      3:**

      MERGE INTO transactions AS T
      USING merge_source AS S
      ON T.id = S.id
      WHEN MATCHED THEN UPDATE SET name='update'
      WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');

       

      There is no error log , just the table rows is not expected when i run sql3 , it looks like nothing changed.

      finally

      I need use sql1 and sql2 to replace sql3 , and to make sure the table rows is expected .**

      Attachments

        Activity

          People

            Unassigned Unassigned
            lxlqwo xiaolo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: