[ https://issues.apache.org/jira/browse/CARBONDATA-1009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kunal Kapoor reassigned CARBONDATA-1009: ---------------------------------------- Assignee: Kunal Kapoor > Select statement is not working with empty string in where clause. > ------------------------------------------------------------------ > > Key: CARBONDATA-1009 > URL: https://issues.apache.org/jira/browse/CARBONDATA-1009 > Project: CarbonData > Issue Type: Bug > Components: sql > Affects Versions: 1.1.0 > Environment: SPARK 2.1 > Reporter: manoj mathpal > Assignee: Kunal Kapoor > Priority: Trivial > > Steps to reproduces: > 1- Create table in hive: > CREATE TABLE uniqdata_h (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 ',' ; > 2:Load data in Hive: > load data local inpath '/home/manoj/Downloads/2000_UniqData.csv' into table uniqdata_h ; > load data local inpath '/home/manoj/Downloads/4000_UniqData.csv' into table uniqdata_h ; > load data local inpath '/home/manoj/Downloads/6000_UniqData.csv' into table uniqdata_h ; > load data local inpath '/home/manoj/Downloads/7000_UniqData.csv' into table uniqdata_h ; > load data local inpath '/home/manoj/3000_1_UniqData.csv' into table uniqdata_h ; > 3: Execute Selet queries: > select CUST_ID,CUST_NAME,DOB,BIGINT_COLUMN1,DECIMAL_COLUMN1,Double_COLUMN1,INTEGER_COLUMN1 from uniqdata_h where CUST_ID in ('10020','10030','10032','10035','10040','10060','',NULL,' ') and BIGINT_COLUMN1 in (123372037874,123372037884,123372037886,123372037889,'',NULL,' ') ; > Result: > +----------+------------------+------------------------+-----------------+-------------------------+----------------------+------------------+--+ > | CUST_ID | CUST_NAME | DOB | BIGINT_COLUMN1 | DECIMAL_COLUMN1 | Double_COLUMN1 | INTEGER_COLUMN1 | > +----------+------------------+------------------------+-----------------+-------------------------+----------------------+------------------+--+ > | 10020 | CUST_NAME_01020 | 1972-10-17 01:00:03.0 | 123372037874 | 12345679921.1234000000 | 1.12345674897976E10 | 1021 | > | 10030 | CUST_NAME_01030 | 1972-10-27 01:00:03.0 | 123372037884 | 12345679931.1234000000 | 1.12345674897976E10 | 1031 | > | 10032 | CUST_NAME_01032 | 1972-10-29 01:00:03.0 | 123372037886 | 12345679933.1234000000 | 1.12345674897976E10 | 1033 | > | 10035 | CUST_NAME_01035 | 1972-11-01 01:00:03.0 | 123372037889 | 12345679936.1234000000 | 1.12345674897976E10 | 1036 | > +----------+------------------+------------------------+-----------------+-------------------------+----------------------+------------------+--+ > ........................................................................................................................................ > Create table in Carbondata.. > 1: create table: > CREATE TABLE uniqdata (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) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES ("TABLE_BLOCKSIZE"= "256 MB") > 2:Load data in table: > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/2000_UniqData_tabdelm.csv' into table uniqdata OPTIONS('DELIMITER'='/' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/3000_UniqDatatdelm.csv' into table uniqdata OPTIONS('DELIMITER'='\t' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/4000_UniqDataquotedelm.csv' into table uniqdata OPTIONS('DELIMITER'='"' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/5000_UniqData!delm.csv' into table uniqdata OPTIONS('DELIMITER'='!' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/6000_UniqData|delm.csv' into table uniqdata OPTIONS('DELIMITER'='|' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/7000_UniqDatadelm.csv' into table uniqdata OPTIONS('DELIMITER'='' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/3000_1_UniqData.csv' into table uniqdata OPTIONS('DELIMITER'=',' , 'QUOTECHAR'='"','BAD_RECORDS_ACTION'='FORCE','FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1') ; > 3: Execute Selet queries: > select CUST_ID,CUST_NAME,DOB,BIGINT_COLUMN1,DECIMAL_COLUMN1,Double_COLUMN1,INTEGER_COLUMN1 from uniqdata where CUST_ID in ('10020','10030','10032','10035','10040','10060','',NULL,' ') and BIGINT_COLUMN1 in (123372037874,123372037884,123372037886,123372037889,'',NULL,' ') ; > Result: > Error: org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 56.0 failed 1 times, most recent failure: Lost task 1.0 in stage 56.0 (TID 216, localhost, executor driver): org.apache.spark.util.TaskCompletionListenerException: java.util.concurrent.ExecutionException: java.lang.NullPointerException > at org.apache.spark.TaskContextImpl.markTaskCompleted(TaskContextImpl.scala:105) > at org.apache.spark.scheduler.Task.run(Task.scala:112) > at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Driver stacktrace: (state=,code=0) -- This message was sent by Atlassian JIRA (v6.3.15#6346) |
Free forum by Nabble | Edit this page |