Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-24403 Improve behaviour of CAST
  3. FLINK-24413

Casting to a CHAR() and VARCHAR() doesn't trim the string to the specified precision

    XMLWordPrintableJSON

Details

    Description

      CAST('abcdfe' AS CHAR(3)) should trim the string to 3 chars but currently returns the whole string 'abcdfe'.

       

      PostgreSQL and Oracle for example behave as such:

      postgres=# select '123456afas'::char(4);
      bpchar
      --------
      1234
      (1 row)

      postgres=# select '123456afas'::varchar(5);
      varchar
      ---------
      12345
      (1 row)

      Attachments

        Issue Links

          Activity

            People

              matriv Marios Trivyzas
              matriv Marios Trivyzas
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: