Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-526

orc-tools convert does not respect second fractions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.2.0, 1.5.5, 1.6.0
    • 1.5.7, 1.6.1, 1.7.0
    • tools
    • None

    Description

      {{% cat timestamp2.csv }}
      2019-01-01 00:00:00.0000
      2015-01-01 00:00:00.0001
      2015-01-01 00:00:00.0000
      2014-12-31 23:59:59.9999
      1970-01-01 00:00:00.0001
      1970-01-01 00:00:00.0000
      1969-12-31 23:59:59.9999
      1969-12-31 23:59:59.0001
      1969-12-31 23:59:59.0000
      1969-12-31 23:59:58.9999
      % java -jar tools/target/orc-tools-1.6.0-SNAPSHOT-uber.jar convert --schema timestamp --timestampformat "yyyy-MM-dd HH:mm:ss.SSSS" timestamp2.csv -o timestamp2-tools16.orc

      Reading back the file generated above excludes the second fractions (nanos).

       

      Reason for this is that tools/convert/CsvReader.java (as well as tools/convert/JsonReader.java) do not consider the nanos.  They just create a Timestamp and never call setNanos() method on it (in this case with the result of a getNano() call to the ZonedDateTime.  This needs to be done in 4 places.  Unfortunately I am not allowed to make a contribution at this point, so I can only describe the problem.  I can confirm with a change/fix like that, the nanos are stored in the resulting ORC file.

      Attachments

        Issue Links

          Activity

            People

              yuokada Yukihiro Okada
              fgroffenorcl Fabian Groffen
              Votes:
              0 Vote for this issue
              Watchers:
              3 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