[
https://issues.apache.org/jira/browse/CALCITE-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032373#comment-15032373
]
Julian Hyde commented on CALCITE-993:
-------------------------------------
I agree with [~jpullokkaran] on the need to form predicates on constant
expressions, not just atoms.
Your code is similar to {{RexProgram.isConstant(RexNode)}}, except that it does
not occur within the context of a {{RexProgram}}. I think you should move your
{{isDeterministicFuncOnLiterals}} method to {{RexUtil}}, rename it
{{isConstant}}, and use a static inner class very similar to
{{RexProgram.ConstantFinder}}. Note that {{ConstantFinder}} returns {{Boolean}}
values rather than throwing (which will satisfy [~vlsi]'s concerns) and also
treats references to bind variables as constants (which I also think is a good
thing).
> Predicate Pull up above Project enhancement
> -------------------------------------------
>
> Key: CALCITE-993
> URL: https://issues.apache.org/jira/browse/CALCITE-993
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.5.0
> Reporter: Laljo John Pullokkaran
> Assignee: Laljo John Pullokkaran
>
> Predicate Pull up on Project can also pull up deterministic functions whose
> arguments are all literals.
> Ex: select r1.x from (select cast('10' as int) as x, y from r1 where y<10)r1
> join r2 on r1.x=r2.x;
> Currently deterministic functions involving constants are ignored which
> results in missed transitive inference.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)