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

Fail to convert output of data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • None
    • None

    Description

      I am using orc-tools on JAR to create an ORC based on a JSON file, and the content is as follows:

       

      {"created":"2019-01-01 16:00:00"}
      

       
      And I use the following command to convert it to json:

      java -jar orc-tools-1.5.4-uber.jar convert --schema "struct<created:timestamp>" --output 6.orc 123.json
      

      and that works ok. So I print the data into JSON again and the ouput is as follows:

      {"created":"2019-01-01 16:00:00.0"}
      

      But when I try to convert the output into ORC again, it raises the following error:

      Exception in thread "main" org.threeten.bp.format.DateTimeParseException: Text '2019-01-01 16:00:00.0' could not be parsed, unparsed text found at index 19
      	at org.threeten.bp.format.DateTimeFormatter.parseToBuilder(DateTimeFormatter.java:1590)
      	at org.threeten.bp.format.DateTimeFormatter.parseBest(DateTimeFormatter.java:1536)
      	at org.apache.orc.tools.convert.JsonReader$TimestampColumnConverter.convert(JsonReader.java:145)
      	at org.apache.orc.tools.convert.JsonReader.nextBatch(JsonReader.java:295)
      	at org.apache.orc.tools.convert.ConvertTool.run(ConvertTool.java:204)
      	at org.apache.orc.tools.convert.ConvertTool.main(ConvertTool.java:165)
      	at org.apache.orc.tools.Driver.main(Driver.java:113)
      
      
      

      Attachments

        Issue Links

          Activity

            People

              yuokada Yukihiro Okada
              tzulberti Tomas Zulberti
              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