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

LazyTimestamp goes into irretrievable NULL mode once inited with NULL once

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.12.0
    • 0.12.0
    • None
    • Fix bad isNull state for LazyTimestamp when encountering valid input after a NULL record.

    Description

      The LazyTimestamp.init() code turns into a NULL generator after parsing the very first NULL value (or format error).

      The code is as follows

          Timestamp t = null;
          if (s.compareTo("NULL") == 0) {
            isNull = true;
            logExceptionMessage(bytes, start, length, "TIMESTAMP");
          } else {
            try {
              t = Timestamp.valueOf(s);
            } catch (IllegalArgumentException e) {
              isNull = true;
              logExceptionMessage(bytes, start, length, "TIMESTAMP");
            }
          }
      

      As might be obvious from the code above, the class does not reset the isNull to false when a parse is successful.

      So if by any reason, it is initialized with a NULL value, the LazyTimestamp.getObject() will always return NULL for all further rows.

      Attachments

        1. HIVE-4757-001.patch
          2 kB
          Gopal Vijayaraghavan

        Issue Links

          Activity

            People

              gopalv Gopal Vijayaraghavan
              gopalv Gopal Vijayaraghavan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: