Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.9.0
-
None
-
None
-
Windows 2012, HDInsight
Description
If table referred does not use all lowercase in INSERT INTO command, the data is not appended but overwritten.
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.dynamic.partition=true;
CREATE TABLE test (key int, value string) PARTITIONED BY (ds string);
SELECT * FROM test;
INSERT INTO TABLE test PARTITION (ds) SELECT key, value, value FROM src;
SELECT * FROM test;
The following statement works as expected. The data from src is appended to test
SELECT * FROM test;
INSERT INTO TABLE test PARTITION (ds) SELECT key, value, value FROM src;
SELECT * FROM test;
The following is copied from the processing log
Loading data to table default.test partition (ds=null)
Loading partition
Loading partition {ds=2}
The following statement does not work. Note the table name referred as Test (not test). INSERT INTO behaves like INSERT OVERWRITE
SELECT * FROM test;
INSERT INTO TABLE Test PARTITION (ds) SELECT key, value, value FROM src;
SELECT * FROM test;
The following is copied from the processing log
Loading data to table default.test partition (ds=null)
Moved to trash: hdfs://localhost:8020/hive/warehouse/test/ds=1
Moved to trash: hdfs://localhost:8020/hive/warehouse/test/ds=2
Loading partition {ds=1}
Loading partition
{ds=2}Attachments
Issue Links
- duplicates
-
HIVE-3062 Insert into table overwrites existing table if table name contains uppercase character
- Closed