Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4160 Vectorized Query Execution in Hive
  3. HIVE-4884

ORC TimestampTreeReader.nextVector() off by a second when time in fractional

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • vectorization-branch
    • vectorization-branch, 0.13.0
    • File Formats
    • None
    • Adjust milliseconds down when encountering a negative second value with a fractional second stored as nanoseconds.

    Description

      When using negative timestamps, the ORC vectorized Timestampreader does the following

      result.vector[i] = (result.vector[i] * 1000000) + nanoVector.vector[i];
      

      This suffers from inaccuracies because the nanoseconds are always positive and the result.vector[i] is in effect

      seconds = (getTime() / 1000)
      nanos = (getNanos())
      // so -42001 ms is written as
      // seconds = -42
      // nanos = 999000000
      // (-42001 / 1000) * 1000 == -42000
      // + 999 ms (from nanos)
      // which is -42999 ms
      

      This needs to be adjusted down if nanos has been zero adjusted, to result in -42001 as the vector[i] value.

      Attachments

        1. HIVE-4884-0000.patch
          2 kB
          Gopal Vijayaraghavan

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: