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

Mihai Budiu commented on CALCITE-7818:
--------------------------------------

Why is this a Druid-specific problem? 

> Druid interval extraction drops rows for mixed OR predicates
> ------------------------------------------------------------
>
>                 Key: CALCITE-7818
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7818
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Bruno Volpato
>            Priority: Major
>
> A Druid filter can combine a timestamp range with a predicate that cannot be 
> represented as an interval. For example:
> `"timestamp" < TIMESTAMP '2020-01-01 00:00:00' OR EXTRACT(DAY FROM 
> "timestamp") = 15`
> A row dated `2021-01-15` satisfies the second branch. Interval extraction 
> currently keeps only the first branch's range. The filter rule treats those 
> partial intervals as the full condition and removes the filter, so the row is 
> lost.
> Expected: retain the full OR predicate and return the matching row.
> Actual: restrict the scan to dates before 2020 and drop the filter.
> Interval extraction should stop when any OR branch cannot be represented as 
> an interval.
> Fix and regression tests: https://github.com/apache/calcite/pull/5243



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

Reply via email to