[jira] [Updated] (HIVE-11477) CBO inserts a UDF cast for integer type promotion (only for negative numbers)

2015-08-07 Thread Pengcheng Xiong (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-11477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pengcheng Xiong updated HIVE-11477:
---
Attachment: HIVE-11477.02.patch

trigger QA run

 CBO inserts a UDF cast for integer type promotion (only for negative numbers)
 -

 Key: HIVE-11477
 URL: https://issues.apache.org/jira/browse/HIVE-11477
 Project: Hive
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: Prasanth Jayachandran
Assignee: Pengcheng Xiong
Priority: Critical
 Attachments: HIVE-11477.01.patch, HIVE-11477.02.patch


 When CBO is enabled, filters which compares tinyint, smallint columns with 
 constant integer types will insert a UDFToInteger cast for the columns. When 
 CBO is disabled, there is no such UDF. This behaviour breaks ORC predicate 
 pushdown feature as ORC ignores UDFs in the filters.
 In the following examples column t is tinyint
 {code:title=Explain for select count(*) from orc_ppd where t  -127; (CBO 
 OFF)}
 Filter Operator [FIL_9]
predicate:(t = 125) (type: boolean)
Statistics:Num rows: 1050 Data size: 611757 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}
 {code:title=Explain for select count(*) from orc_ppd where t  -127; (CBO ON)}
 Filter Operator [FIL_10]
predicate:(UDFToInteger(t)  -127) (type: boolean)
Statistics:Num rows: 700 Data size: 407838 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}
 CBO does not insert such cast for non-negative numbers
 {code:title=Explain for select count(*) from orc_ppd where t  127; (CBO ON)}
 Filter Operator [FIL_10]
predicate:(t  127) (type: boolean)
Statistics:Num rows: 700 Data size: 407838 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HIVE-11477) CBO inserts a UDF cast for integer type promotion (only for negative numbers)

2015-08-06 Thread Prasanth Jayachandran (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-11477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prasanth Jayachandran updated HIVE-11477:
-
Priority: Critical  (was: Major)

 CBO inserts a UDF cast for integer type promotion (only for negative numbers)
 -

 Key: HIVE-11477
 URL: https://issues.apache.org/jira/browse/HIVE-11477
 Project: Hive
  Issue Type: Bug
Affects Versions: 2.0.0
Reporter: Prasanth Jayachandran
Assignee: Pengcheng Xiong
Priority: Critical

 When CBO is enabled, filters which compares tinyint, smallint columns with 
 constant integer types will insert a UDFToInteger cast for the columns. When 
 CBO is disabled, there is no such UDF. This behaviour breaks ORC predicate 
 pushdown feature as ORC ignores UDFs in the filters.
 In the following examples column t is tinyint
 {code:title=Explain for select count(*) from orc_ppd where t  -127; (CBO 
 OFF)}
 Filter Operator [FIL_9]
predicate:(t = 125) (type: boolean)
Statistics:Num rows: 1050 Data size: 611757 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}
 {code:title=Explain for select count(*) from orc_ppd where t  -127; (CBO ON)}
 Filter Operator [FIL_10]
predicate:(UDFToInteger(t)  -127) (type: boolean)
Statistics:Num rows: 700 Data size: 407838 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}
 CBO does not insert such cast for non-negative numbers
 {code:title=Explain for select count(*) from orc_ppd where t  127; (CBO ON)}
 Filter Operator [FIL_10]
predicate:(t  127) (type: boolean)
Statistics:Num rows: 700 Data size: 407838 Basic 
 stats: COMPLETE Column stats: NONE
TableScan [TS_0]
   alias:orc_ppd
   Statistics:Num rows: 2100 Data size: 1223514 
 Basic stats: COMPLETE Column stats: NONE
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)