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

Pengcheng Xiong commented on CALCITE-935:
-----------------------------------------

Hi Julian, Thanks for your efforts. I thought about the multi map for a while 
and I changed it back to basic map due to 2 reasons (1) as RexLiteral is 
immutable too, a constant '10' is different from a constant '10'. Thus there 
will be two values of '10'. (2) We only need a single literal value. Storing 
multiple values in a multi-map is not that useful. The new patch is in 
https://github.com/julianhyde/incubator-calcite/commit/ee02796a4f7a1c26f040657bb58026fa03da8666
 and I already sent u a pull request. Plz let me know what you think. Thanks.

> Improve how ReduceExpressionsRule handles duplicate constraints
> ---------------------------------------------------------------
>
>                 Key: CALCITE-935
>                 URL: https://issues.apache.org/jira/browse/CALCITE-935
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>             Fix For: 1.5.0
>
>         Attachments: CALCITE-935.01.patch
>
>
> We need to improve ReduceExpressionRule to deal with multiple "equals to 
> literal" in predicate. In ReduceExpressionRule.java, L396-397:
> {code}final ImmutableMap<RexNode, RexLiteral> constants =
>        predicateConstants(predicates);{code}
> The query is {code}select * from src where (key='12' and key is null);{code} 
> Here 'key' is a string type and it is one of the columns of 'src' table.
> Then we will have predicates {noformat}[=($0, '12'), 
> isnull($0)]{noformat}which is the input of the
> predicateConstants, and the function will return "{$0='12'}"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to