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

Quanlong Huang updated IMPALA-11960:
------------------------------------
    Summary: Incorrect expression rewrites of date and timestamp conjuncts  
(was: Incorrect expression rewrites of data and timestamp conjuncts)

> Incorrect expression rewrites of date and timestamp conjuncts
> -------------------------------------------------------------
>
>                 Key: IMPALA-11960
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11960
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: Csaba Ringhofer
>            Priority: Major
>              Labels: correctness
>
> To reproduce:
> {code}
> create table t3 (b timestamp, ti date);
> insert into t3 values ("2023-01-01 09:00:00", "2023-01-01");
> enable_expr_rewrites=true;
> select * from t3 where ti = cast(b as date) and  b <'2023-01-01 15:00:00';
> -- returned 0 row
> enable_expr_rewrites=false;
> select * from t3 where ti = cast(b as date) and  b <'2023-01-01 15:00:00';
> -- returned 1 row
> {code}
> The cause seems to be that a conjunct like ti <cast(cast('2023-01-01 
> 15:00:00' as timestamp) as date) is created during
> https://github.com/apache/impala/blob/23c265d12804c91c08a08a0be92c155424ea3d99/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java#L1860
> Casting the right side to date leads to truncating the time part and 
> rejecting values during the given day.
> The issue was probably introduced by IMPALA-10064:



--
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