[
https://issues.apache.org/jira/browse/CALCITE-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15999344#comment-15999344
]
Jesus Camacho Rodriguez commented on CALCITE-1769:
--------------------------------------------------
[~bslim], I understand if there is no CAST, it will be pushed, which seems
correct. But ignoring the CAST is not the right approach and might lead to
incorrect results (let's forget for a second whether the expression is
generated by Hive or Calcite; maybe we do not produce an expression from this
systems, but if the expression is valid in Calcite then other system can
produce it).
You are mentioning that the expression above gets folded by Calcite. The
question is: _why the original CAST on constant that you are targeting is not
getting folded?_ Since there is a CAST on literal, I think the correct approach
is to use the executor to simplify it, instead of ignoring the CAST. If the
executor is leaving the CAST on the literal for some cases (this is apparently
what is happening using Hive), we need to know the root cause of that and
extend the executor accordingly to fold it.
Cc [~ashutoshc]
> Push Filters down to druid when there a cast to numeric
> -------------------------------------------------------
>
> Key: CALCITE-1769
> URL: https://issues.apache.org/jira/browse/CALCITE-1769
> Project: Calcite
> Issue Type: Bug
> Components: druid
> Reporter: slim bouguerra
> Assignee: Julian Hyde
> Fix For: 1.13.0
>
>
> Currently if we have cast to numeric over literal filter will not get pushed.
> For instance query like {code}SELECT page from druid_table_1 WHERE page < 5
> group by page {code} from hive will introduce a cast over `5`.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)