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

Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

    XMLWordPrintableJSON

Details

    Description

      Test case:
      column values with space and tab character 

      bash-4.2$ cat data/files/test_dec_space.csv
      1,0
      2, 1
      3,	2
      create external table test_dec_space (id int, value decimal) ROW FORMAT DELIMITED
       FIELDS TERMINATED BY ',' location '/tmp/test_dec_space';
      

      output of select * from test_dec_space would be

      1	0
      2	1
      3	NULL

      The behaviour in MySQL when there is tab & space characters in decimal values

      bash-4.2$ cat /tmp/insert.csv 
      "1","aa",11.88
      "2","bb", 99.88
      "4","dd",	209.88

       

      MariaDB [test]> load data local infile '/tmp/insert.csv' into table t2 fields terminated by ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
      
       Query OK, 3 rows affected, 3 warnings (0.00 sec) 
       Records: 3 Deleted: 0 Skipped: 0 Warnings: 3
      
      MariaDB [test]> select * from t2;
      +------+------+-------+
      | id   | name | score |
      +------+------+-------+
      | 1    | aa   |    12 |
      | 2    | bb   |   100 |
      | 4    | dd   |   210 |
      +------+------+-------+
       3 rows in set (0.00 sec)
      

      So in hive also we can make it work by skipping tab character

      Attachments

        Issue Links

          Activity

            People

              tarak271 Taraka Rama Rao Lethavadla
              tarak271 Taraka Rama Rao Lethavadla
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m