[ 
https://issues.apache.org/jira/browse/IMPALA-14814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18063629#comment-18063629
 ] 

Steve Carlin commented on IMPALA-14814:
---------------------------------------

Including another query with a similar issue here, though the fix might be a 
different part of the code



select count(*) from functional_orc_def.alltypessmall where tinyint_col > 
1000000000000


In this situation, the cast looks the same for original and Calcite.



An implicit cast is being placed on tinyint_col and there is code that does not 
unwrap the SlotRef because of this cast. Simply getting rid of that code may 
cause other failures, that needs to be investigated. Another way to fix this is 
by putting in a rule that simplifies this filter into a false expression since 
there is no way that this can return any rows.

 

> Calcite planner: orc stats predicate not created due to decimal cast
> --------------------------------------------------------------------
>
>                 Key: IMPALA-14814
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14814
>             Project: IMPALA
>          Issue Type: Sub-task
>            Reporter: Steve Carlin
>            Priority: Major
>
> In orc-stats.test for the following query:
> select count(*) from functional_orc_def.decimal_tbl where d1 > 132842.0;
> The orc statistics predicate is not getting created in the Calcite Planner.
> This is because the predicate is finding a common type for the filter 
> condition, which is:
> CAST(functional_orc_def.decimal_tbl.d1 AS DECIMAL(10,1)) > CAST(132842.0 AS 
> DECIMAL(10,1))
> d1 is a (9,0)
> In the original planner, no casting is done, so the orc stats predicate gets 
> created:
> d1 > CAST(132842.0 AS DECIMAL(7,1))



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to