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

UDFSpace result length calculation is incorrect after HADOOP-17901 and HADOOP-17905

    XMLWordPrintableJSON

Details

    Description

      The changes added in HADOOP-17901 and HADOOP-17905 introduced some issues in Hive side. UDFSpace is generating false output because the result length is not determined correctly. It is causing unexpected characters in the result.

      Repro steps:

      create table t(i int);
      insert into t values (5),(6),(7),(8),(9),(10),(11),(12),(13),(14);
      select i, SPACE(i) from t;

       
      Faulty output:

      +-----+-----------------+
      |  i  |       _c1       |
      +-----+-----------------+
      | 5   |                 |
      | 6   |                 |
      | 7   |                |
      | 8   |                 |
      | 9   |                |
      | 10  |               |
      | 11  |                 |
      | 12  |                |
      | 13  |               |
      | 14  |              |
      +-----+-----------------+
      

       

      Also by using --outputformat=csv the generated file contains 0 ascii characters(“EOF”) instead of spaces.

      Attachments

        Issue Links

          Activity

            People

              mbathori Mark Bathori
              mbathori Mark Bathori
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20m
                  20m