[ 
https://issues.apache.org/jira/browse/CALCITE-1517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dongming Liu updated CALCITE-1517:
----------------------------------
    Description: 
SQL

{code}
select * from ta where ta.a <> '';
{code}

If the type of {{ta.a}} is {{CHAR(1)}}, when I call {{SqlToRelConverter}}, will 
add a CAST  function to cast the empty string to CHAR(1), like this:

{code}
CAST(''):CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" 
NOT NULL
{code}

But, when I use the {{ReduceExpressionsRule}} rule in planner, it will remove 
the cast and convert the empty string '' to ' '(string with a space)。Obviously, 
'' is not equal to ' '。

Is this a bug?

  was:
SQL

{code}
select * from t1 where ta.a <> '';
{code}

If the type of {{ta.a}} is {{CHAR(1)}}, when I call {{SqlToRelConverter}}, will 
add a CAST  function to cast the empty string to CHAR(1), like this:

{code}
CAST(''):CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" 
NOT NULL
{code}

But, when I use the {{ReduceExpressionsRule}} rule in planner, it will remove 
the cast and convert the empty string '' to ' '(string with a space)。Obviously, 
'' is not equal to ' '。

Is this a bug?


> Calcite use ReduceExpressionsRule make '' to ' '
> ------------------------------------------------
>
>                 Key: CALCITE-1517
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1517
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.11.0
>            Reporter: Dongming Liu
>            Assignee: Julian Hyde
>
> SQL
> {code}
> select * from ta where ta.a <> '';
> {code}
> If the type of {{ta.a}} is {{CHAR(1)}}, when I call {{SqlToRelConverter}}, 
> will add a CAST  function to cast the empty string to CHAR(1), like this:
> {code}
> CAST(''):CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE 
> "ISO-8859-1$en_US$primary" NOT NULL
> {code}
> But, when I use the {{ReduceExpressionsRule}} rule in planner, it will remove 
> the cast and convert the empty string '' to ' '(string with a 
> space)。Obviously, '' is not equal to ' '。
> Is this a bug?



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

Reply via email to