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

Julian Hyde commented on CALCITE-4978:
--------------------------------------

Thanks, that helps. I'm pushing back hard because everything can be 'product 
dependent' but if we try hard we can find patterns.

Can you give a good definition of 'constant'? Clearly literals are constants. 
Also pure functions whose arguments are all constant. But what else?

Your range function is a good example, but that simplification could 
potentially be done using sarg range simplification. See 
[Range.canonical(DiscreteDomain)|https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Range.html#canonical-com.google.common.collect.DiscreteDomain-].

If there are ways that an operator could declare a call to be 'constant', that 
would be useful. Maybe it should be a property of the operator; or maybe there 
should be new kind of metadata that recognizes constants.

> Allow custom constant map in RelOptPredicateList
> ------------------------------------------------
>
>                 Key: CALCITE-4978
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4978
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.29.0
>            Reporter: Vladimir Ozerov
>            Assignee: Vladimir Ozerov
>            Priority: Minor
>
> {{RelOptPredicateList}} tries to infer constants from the predicates passed 
> to the {{of(...)}} factory methods. However, the underlying mechanic is 
> limited and handles only a small subset of possible constant derivation 
> strategies. We may want to implement such strategies gradually (inference 
> from AND/OR, ranges, etc.), but it might be a big effort. 
> This ticket proposes a new factory method that allows users to pass custom 
> constant maps.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to