Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1517

Calcite use ReduceExpressionsRule make '' to ' '

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.11.0
    • 1.11.0
    • None
    • None

    Description

      SQL

      select * from ta where ta.a <> '';
      

      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:

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

      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?

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            dongming Dongming Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: