Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20520

length(CHAR) doesn't consider trailing space

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • 4.0.0-alpha-2
    • UDF
    • None

    Description

      Reproduce steps:

      create table test(a char(2), b varchar(2));
      insert into test values('L ', 'L ');
      select length(a),length(b) from test;
      +------+------+
      | _c0  | _c1  |
      +------+------+
      | 1    | 2    |
      +------+------+
      1 row selected (0.185 seconds)
      

      Here char with trailing spaces are trimmed, whereas leading spaces are not trimmed.

      Attachments

        1. HIVE-20520.patch
          9 kB
          jcamachorodriguez
        2. HIVE-20520.02.patch
          24 kB
          jcamachorodriguez
        3. HIVE-20520.02.patch
          24 kB
          jcamachorodriguez
        4. HIVE-20520.02.patch
          24 kB
          jcamachorodriguez
        5. HIVE-20520.01.patch
          19 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              nareshpr Naresh P R
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: