Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-731 Improve `Java Tools`
  3. ORC-871

`orc-tools json-schema` fails at empty json file with EOFException

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6.9
    • 1.7.0
    • Java, tools
    • None

    Description

      It would be better if we show some valid information about the empty file instead of throwing `EOFException`.

      $ orc-tools version
      ORC 1.6.9
      
      $ touch empty.json
      
      $ orc-tools json-schema empty.json
      Reading file empty.json
      Exception in thread "main" com.google.gson.JsonIOException: java.io.EOFException: End of input at line 1 column 1
      	at com.google.gson.JsonStreamParser.hasNext(JsonStreamParser.java:109)
      	at org.apache.orc.tools.json.JsonSchemaFinder.addFile(JsonSchemaFinder.java:255)
      	at org.apache.orc.tools.json.JsonSchemaFinder.addFile(JsonSchemaFinder.java:250)
      	at org.apache.orc.tools.json.JsonSchemaFinder.main(JsonSchemaFinder.java:332)
      	at org.apache.orc.tools.Driver.main(Driver.java:114)
      Caused by: java.io.EOFException: End of input at line 1 column 1
      	at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1377)
      	at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1514)
      	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:523)
      	at com.google.gson.stream.JsonReader.peek(JsonReader.java:414)
      	at com.google.gson.JsonStreamParser.hasNext(JsonStreamParser.java:105)
      	... 4 more
      

      Attachments

        Issue Links

          Activity

            People

              Guiyankuang Yiqun Zhang
              dongjoon Dongjoon Hyun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: