Vandana Yadav created CARBONDATA-2665:
-----------------------------------------

             Summary: Incorrect result displays after executing select Query
                 Key: CARBONDATA-2665
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2665
             Project: CarbonData
          Issue Type: Bug
          Components: data-query
    Affects Versions: 1.5.0
         Environment: spark 2.2
            Reporter: Vandana Yadav
         Attachments: 2000_UniqData.csv, 3000_1_UniqData.csv, 
4000_UniqData.csv, 6000_UniqData.csv, 7000_UniqData.csv

Incorrect result displays after executing select Query:

Steps to reproduce:

1)

1) Create a table in carbondata and load data in it.

a) 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")

b) LOAD DATA INPATH 'HDFS_URL/BabuStore/Data/uniqdata/2000_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')

c) LOAD DATA INPATH 
'hdfs://hadoop-master:54311/BabuStore/Data/uniqdata/4000_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')

d) LOAD DATA INPATH 
'hdfs://hadoop-master:54311/BabuStore/Data/uniqdata/6000_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')

e) LOAD DATA INPATH 
'hdfs://hadoop-master:54311/BabuStore/Data/uniqdata/7000_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')

f) LOAD DATA INPATH 
'hdfs://hadoop-master:54311/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')

 

2) create a table with hive and load data in it:

a) 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 ','

b) load data local inpath 
'/opt/Carbon/CarbonData/TestData/Data/uniqdata/2000_UniqData.csv' into table 
uniqdata_h

c) load data local inpath 
'/opt/Carbon/CarbonData/TestData/Data/uniqdata/4000_UniqData.csv' into table 
uniqdata_h

d) load data local inpath 
'/opt/Carbon/CarbonData/TestData/Data/uniqdata/6000_UniqData.csv' into table 
uniqdata_h

e) load data local inpath 
'/opt/Carbon/CarbonData/TestData/Data/uniqdata/7000_UniqData.csv' into table 
uniqdata_h

f) load data local inpath 
'/opt/Carbon/CarbonData/TestData/Data/uniqdata/3000_1_UniqData.csv' into table 
uniqdata_h

 

3) Execute the desired Query:

a) on carbon table:

select max(datediff(DOB,DOJ)),min(datediff(DOB,DOJ)),count(datediff(DOB,DOJ)) 
from uniqdata where CUST_ID IS NULL or DOJ IS NOT NULL or BIGINT_COLUMN1 
=1233720368578 or DECIMAL_COLUMN1 = 12345678901.1234000058 or Double_COLUMN1 = 
1.12345674897976E10 or INTEGER_COLUMN1 IS NULL

b) on hive table:

select max(datediff(DOB,DOJ)),min(datediff(DOB,DOJ)),count(datediff(DOB,DOJ)) 
from uniqdata_h where CUST_ID IS NULL or DOJ IS NOT NULL or BIGINT_COLUMN1 
=1233720368578 or DECIMAL_COLUMN1 = 12345678901.1234000058 or Double_COLUMN1 = 
1.12345674897976E10 or INTEGER_COLUMN1 IS NULL

 

4) Expected Result:

As we are executing both queries on the same data set that's why the result 
should be same.

5) Actual Result:

a) Carbondata:

 output

+------------------------------------------------------+------------------------------------------------------+--------------------------------------------------------+--+
| max(datediff(CAST(DOB AS DATE), CAST(DOJ AS DATE))) | min(datediff(CAST(DOB 
AS DATE), CAST(DOJ AS DATE))) | count(datediff(CAST(DOB AS DATE), CAST(DOJ AS 
DATE))) |
+------------------------------------------------------+------------------------------------------------------+--------------------------------------------------------+--+
| 0 | 0 | 21962 |
+------------------------------------------------------+------------------------------------------------------+--------------------------------------------------------+--+
1 row selected (0.369 seconds) 

 

 

b) Hive :

----------+--+
| max(datediff(CAST(DOB AS DATE), CAST(DOJ AS DATE))) | min(datediff(CAST(DOB 
AS DATE), CAST(DOJ AS DATE))) | count(datediff(CAST(DOB AS DATE), CAST(DOJ AS 
DATE))) |
+------------------------------------------------------+------------------------------------------------------+--------------------------------------------------------+--+
| 0 | 0 | 22001 |
+------------------------------------------------------+------------------------------------------------------+--------------------------------------------------------+--+

 



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

Reply via email to