07-15-2017 04:42 PM
According to the above link, Take out any CREATE INDEX, DROP INDEX, and ALTER INDEX statements, and equivalent ALTER TABLEstatements. Remove any INDEX, KEY, or PRIMARY KEY clauses from CREATE TABLE and ALTER TABLE statements. Impala is optimized for bulk read operations for data warehouse-style queries, and therefore does not support indexes for its tables.
Yes in general, you cannot achieve both Performance and Indexing. So if possible, you can try to control duplicate in the source (select) portion instead of target (insert) portion
insert into table trg_table
select * from src_table
07-15-2017 08:03 PM
Impala does not have a concept of PK .However You have two options
down the road if you want to implement delete single row you cant perform them on Hive / Impala . So you can implement using Impala-kudu format . Kudu format you can create table with primary key , plus you perform single row delete.
or the hard way to achive this is to
CREATE TABLE Sample ( name STRING, street STRING, RD123 Timestamp ,(Assume this is unique since we dont have Pk) ) STEP 2
Perform the LOAD DATA INTO Sample
STEP 3 - Create another table
Create table sample_no_dupli AS select SELECT col1,col2,MAX(RD123) AS createdate FROM JLT_STAHING GROUP BY name,street