[
https://issues.apache.org/jira/browse/CALCITE-7088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18003549#comment-18003549
]
Julian Hyde commented on CALCITE-7088:
--------------------------------------
There are countless logical identities, and we can’t cover them all. May I ask
why you “expected” that “%%” would be simplified? Why not also “%%%%%%”?
Furthermore, you say in the description that it should simplify to TRUE. That
is a leap - a further optimization that relies on a NOT NULL condition.
> X LIKE '%%' should simply to X=X
> --------------------------------
>
> Key: CALCITE-7088
> URL: https://issues.apache.org/jira/browse/CALCITE-7088
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.40.0
> Reporter: Yu Xu
> Assignee: Yu Xu
> Priority: Minor
> Fix For: 1.41.0
>
>
> sql:
> {code:java}
> "select \"product_name\" like '%' from \"product\""; {code}
> would convert as expected:
> {code:java}
> "SELECT TRUE\nFROM \"foodmart\".\"product\"" ;{code}
> but sql:
> {code:java}
> "select \"product_name\" like '%%' from \"product\"";{code}
> would convert not as expected:
> {code:java}
> "SELECT \"product_name\" LIKE '%%'\nFROM \"foodmart\".\"product\"" ;{code}
>
> LIKE '%%...' should keep the same with LIKE '%'
--
This message was sent by Atlassian Jira
(v8.20.10#820010)