Dongjoon Hyun created ORC-871:
---------------------------------

             Summary: `orc-tools json-schema` fails at empty json file with 
EOFException
                 Key: ORC-871
                 URL: https://issues.apache.org/jira/browse/ORC-871
             Project: ORC
          Issue Type: Bug
          Components: Java, tools
    Affects Versions: 1.6.9
            Reporter: Dongjoon Hyun


It would be better if we show some valid information about the empty file 
instead of throwing `EOFException`.
{code}
$ 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
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to