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

Preserving CAST of STRING operand in binary comparison for PostgreSQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.39.0
    • None

    Description

      In Postgresql:

      SELECT * FROM table where cast('10' as text)  = 1; // throw operator does not exist: text = integer
      SELECT * FROM table where cast('10' as varchar)  = 1; // operator does not exist: character varying = integer
      SELECT * FROM table where cast('10' as char)  = 1; //operator does not exist: character = integer

      So when generating Postgres SQL, we need to preserve the CAST of STRING.

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: