You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "xiaolo (JIRA)" <ji...@apache.org> on 2018/02/26 03:37:00 UTC

[jira] [Created] (HIVE-18801) MERGE INTO SQL not work fully

xiaolo created HIVE-18801:
-----------------------------

             Summary: MERGE INTO SQL not work fully
                 Key: HIVE-18801
                 URL: https://issues.apache.org/jira/browse/HIVE-18801
             Project: Hive
          Issue Type: Bug
          Components: Clients
    Affects Versions: 2.3.2
         Environment: CREATE TABLE transactions(
id int,
name string
)
PARTITIONED BY (partition_date string)
CLUSTERED BY (ID) into 5 buckets 
STORED AS ORC TBLPROPERTIES ('transactional'='true');


CREATE TABLE merge_source(
id int,
name string);
            Reporter: xiaolo


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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)