[ https://issues.apache.org/jira/browse/CARBONDATA-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Geetika Gupta updated CARBONDATA-1989: -------------------------------------- Description: I created table using: CREATE TABLE uniqdata_string_new(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'); Load command: LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' into table uniqdata_string_new partition(active_emui_version='abc') 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'); LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' into table uniqdata_string_new partition(active_emui_version='xyz') 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'); show partitions command: show partitions uniqdata_string; Output: 0: jdbc:hive2://localhost:10000> show partitions uniqdata_string_new; --------------------------+ partition --------------------------+ active_emui_version=abc active_emui_version=xyz --------------------------+ select query: 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; +-----------+--+ | count(1) | +-----------+--+ | 4026 | +-----------+--+ Drop partition query: alter table uniqdata_string_new drop partition(active_emui_version='xyz'); show partitions uniqdata_string_new; +--------------------------+--+ | partition | +--------------------------+--+ | active_emui_version=abc | +--------------------------+--+ Select query: 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; +-----------+--+ | count(1) | +-----------+--+ | 2013 | +-----------+--+ Previously there were 4026 records and after dropping the partition, the records got reduced to 2013. was: I created table using: CREATE TABLE uniqdata_string(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'); Load command: LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' into table uniqdata_string partition(active_emui_version='abc') 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'); LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' into table uniqdata_string partition(active_emui_version='xyz') 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'); show partitions command: show partitions uniqdata_string; Output: 0: jdbc:hive2://localhost:10000> show partitions uniqdata_string_new; --------------------------+ partition --------------------------+ active_emui_version=abc active_emui_version=xyz --------------------------+ select query: 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; +-----------+--+ | count(1) | +-----------+--+ | 4026 | +-----------+--+ Drop partition query: alter table uniqdata_string_new drop partition(active_emui_version='xyz'); show partitions uniqdata_string_new; +--------------------------+--+ | partition | +--------------------------+--+ | active_emui_version=abc | +--------------------------+--+ Select query: 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; +-----------+--+ | count(1) | +-----------+--+ | 2013 | +-----------+--+ Previously there were 4026 records and after dropping the partition, the records got reduced to 2013. > Drop partition is dropping table data > ------------------------------------- > > Key: CARBONDATA-1989 > URL: https://issues.apache.org/jira/browse/CARBONDATA-1989 > Project: CarbonData > Issue Type: Bug > Components: data-query > Affects Versions: 1.3.0 > Environment: spark2.1 > Reporter: Geetika Gupta > Fix For: 1.3.0 > > Attachments: 2000_UniqData.csv > > > I created table using: > CREATE TABLE uniqdata_string_new(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'); > Load command: > LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' > into table uniqdata_string_new partition(active_emui_version='abc') 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'); > LOAD DATA INPATH 'hdfs://localhost:54311/2000_UniqData.csv' > into table uniqdata_string_new partition(active_emui_version='xyz') 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'); > show partitions command: > show partitions uniqdata_string; > Output: > 0: jdbc:hive2://localhost:10000> show partitions uniqdata_string_new; > --------------------------+ > partition > --------------------------+ > active_emui_version=abc > active_emui_version=xyz > --------------------------+ > select query: > 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; > +-----------+--+ > | count(1) | > +-----------+--+ > | 4026 | > +-----------+--+ > Drop partition query: > alter table uniqdata_string_new drop partition(active_emui_version='xyz'); > show partitions uniqdata_string_new; > +--------------------------+--+ > | partition | > +--------------------------+--+ > | active_emui_version=abc | > +--------------------------+--+ > Select query: > 0: jdbc:hive2://localhost:10000> select count(*) from uniqdata_string_new; > +-----------+--+ > | count(1) | > +-----------+--+ > | 2013 | > +-----------+--+ > Previously there were 4026 records and after dropping the partition, the records got reduced to 2013. -- This message was sent by Atlassian JIRA (v6.4.14#64029) |
Free forum by Nabble | Edit this page |