You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dongming Liu (JIRA)" <ji...@apache.org> on 2016/11/30 10:06:58 UTC

[jira] [Created] (CALCITE-1517) Calcite use ReduceExpressionsRule make '' to ' '

Dongming Liu created CALCITE-1517:
-------------------------------------

             Summary: 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 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?



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