Akash R Nilugal created CARBONDATA-2060:
-------------------------------------------

             Summary: Fix InsertOverwrite on partition table
                 Key: CARBONDATA-2060
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2060
             Project: CarbonData
          Issue Type: Bug
            Reporter: Akash R Nilugal
            Assignee: Akash R Nilugal


{color:#333333}when partition table overwrite with empty table , it is not 
overwriting the partition table , and when insert overwrite is done on dynamic 
partition table , overwrite was not happening.{color}

 

{color:#333333}sql("create table partitionLoadTable(name string, age int) 
PARTITIONED BY(address string) stored by 'carbondata'"){color}
{color:#333333}sql("insert into partitionLoadTable select 'abc',4,'def'"){color}
{color:#333333}sql("insert into partitionLoadTable select 'abd',5,'xyz'"){color}
{color:#333333}sql("create table noLoadTable (name string, age int, address 
string) stored by 'carbondata'"){color}
{color:#333333}sql("insert overwrite table partitionLoadTable select * from 
noLoadTable"){color}

{color:#333333}when we do select * after insert overwrite operation, ideally it 
should give empty data, but it is giving all data.{color}

 

{color:#333333}sql("CREATE TABLE uniqdata_hive_static (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, DOJ timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double, INTEGER_COLUMN1 
int)ROW FORMAT DELIMITED FIELDS TERMINATED BY ','"){color}
{color:#333333}sql("CREATE TABLE uniqdata_string_static(CUST_ID int,CUST_NAME 
String,DOB timestamp,DOJ timestamp, BIGINT_COLUMN1 bigint,BIGINT_COLUMN2 
bigint,DECIMAL_COLUMN1 decimal(30,10),DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY(ACTIVE_EMUI_VERSION string) STORED BY 
'org.apache.carbondata.format' TBLPROPERTIES ('TABLE_BLOCKSIZE'= '256 
MB')"){color}
{color:#333333}sql(s"LOAD DATA INPATH '$resourcesPath/partData.csv' into table 
uniqdata_string_static OPTIONS('FILEHEADER'='CUST_ID,CUST_NAME 
,ACTIVE_EMUI_VERSION,DOB,DOJ, 
BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1, 
Double_COLUMN2,INTEGER_COLUMN1','BAD_RECORDS_ACTION'='FORCE')"){color}
{color:#333333}sql(s"LOAD DATA INPATH '$resourcesPath/partData.csv' into table 
uniqdata_string_static OPTIONS('FILEHEADER'='CUST_ID,CUST_NAME 
,ACTIVE_EMUI_VERSION,DOB,DOJ, 
BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1, 
Double_COLUMN2,INTEGER_COLUMN1','BAD_RECORDS_ACTION'='FORCE')"){color}

{color:#333333}sql("insert overwrite table uniqdata_string_static select 
CUST_ID, CUST_NAME,DOB,doj, bigint_column1, bigint_column2, decimal_column1, 
decimal_column2,double_column1, 
double_column2,integer_column1,active_emui_version from uniqdata_hive_static 
limit 10"){color}

 

{color:#333333}after this, select * was giving result, ideally it should give 
empty result.{color}

 



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

Reply via email to