-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORC-634: Fix the json output for double NaN and infinite
### What changes were proposed in this pull request? The meta command of tools supports outputting NaN and infinite of Double type. ### Why are the changes needed? When ORC's double type data contains NaN or infinite, dump data cannot work properly, and outputting meta in json will also fail. ```java java.lang.IllegalArgumentException: Numeric values must be finite, but was NaN at com.google.gson.stream.JsonWriter.value(JsonWriter.java:505) at org.apache.orc.tools.PrintData.printValue(PrintData.java:140) at org.apache.orc.tools.PrintData.printRow(PrintData.java:192) at org.apache.orc.tools.PrintData.printJsonData(PrintData.java:215) at org.apache.orc.tools.PrintData.main(PrintData.java:288) at org.apache.orc.tools.FileDump.main(FileDump.java:129) at org.apache.orc.tools.FileDump.main(FileDump.java:144) ``` ```java Exception in thread "main" java.lang.IllegalStateException: Nesting problem. at com.google.gson.stream.JsonWriter.beforeName(JsonWriter.java:648) at com.google.gson.stream.JsonWriter.writeDeferredName(JsonWriter.java:408) at com.google.gson.stream.JsonWriter.value(JsonWriter.java:424) at org.apache.orc.tools.JsonFileDump.printJsonMetaData(JsonFileDump.java:229) at org.apache.orc.tools.FileDump.main(FileDump.java:135) at org.apache.orc.tools.Driver.main(Driver.java:124) ``` ### How was this patch tested? add UT ### Was this patch authored or co-authored using generative AI tooling? No Closes #1770 from cxzl25/ORC-634. Authored-by: sychen <sychen@ctrip.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit dc2449b) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
- Loading branch information
1 parent
6d2c476
commit 9bc4f9d
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters