-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORC-1697: Fix IllegalArgumentException when reading json timestamp type in benchmark #1930
Closed
Conversation
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
Thank you, @cxzl25 . +1, LGTM. |
Currently, GitHub outage is happening. I failed to merge this PR. I'll re-try to merge this later. |
dongjoon-hyun
approved these changes
Aug 5, 2024
dongjoon-hyun
pushed a commit
that referenced
this pull request
Aug 5, 2024
…pe in benchmark ### What changes were proposed in this pull request? This PR aims to fix `IllegalArgumentException` when reading json timestamp type in benchmark. Write and read json, convert timestamp type to long type instead of string type. ### Why are the changes needed? ORC-1191 Switch the csv format of taxi to parquet and read the timestamp format of parquet, but it is in microseconds format, which is different from the millisecond format of Java's `java.sql.Timestamp`. taxi source parquet meta ```bash optional int64 tpep_pickup_datetime (TIMESTAMP(MICROS,false)); optional int64 tpep_dropoff_datetime (TIMESTAMP(MICROS,false)); ``` When we write the data into json and then use the scan command, we will get the following error. ```java java -jar core/target/orc-benchmarks-core-*-uber.jar scan data -format json ``` ``` Exception in thread "main" java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] at java.sql/java.sql.Timestamp.valueOf(Timestamp.java:224) at org.apache.orc.bench.core.convert.json.JsonReader$TimestampColumnConverter.convert(JsonReader.java:175) at org.apache.orc.bench.core.convert.json.JsonReader.nextBatch(JsonReader.java:86) at org.apache.orc.bench.core.convert.ScanVariants.run(ScanVariants.java:92) at org.apache.orc.bench.core.Driver.main(Driver.java:64) ``` Because json data of type timestamp is written via `java.sql.Timestamp#toString`, but reading the data `java.sql.Timestamp#valueOf` will report an error. ```java Timestamp ts = new Timestamp(1446341079000000L); System.out.println(ts); System.out.println(Timestamp.valueOf(ts.toString())); ``` ``` 47802-09-23 02:50:00.0 Exception in thread "main" java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] at java.sql.Timestamp.valueOf(Timestamp.java:237) ``` ### How was this patch tested? local test ```bash java -jar core/target/orc-benchmarks-core-*-uber.jar generate data -format json -data taxi -compress snappy ``` ```bash java -jar core/target/orc-benchmarks-core-*-uber.jar scan data -format json -data taxi -compress snappy ``` ### Was this patch authored or co-authored using generative AI tooling? No Closes #1902 Closes #1930 from cxzl25/ORC-1697_v2. Authored-by: sychen <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit d09dbf3) Signed-off-by: Dongjoon Hyun <[email protected]>
Merged to main/2.0. |
dongjoon-hyun
added a commit
that referenced
this pull request
Aug 5, 2024
### What changes were proposed in this pull request? This PR aims to use Apache Avro 1.12.0 in `bench` module. ### Why are the changes needed? Apache Avro 1.12.0 is the latest feature release. Since we are fixing this area recently, we had better keep it up-to-date in order to avoid re-validation in the future. - #1930 - #1995 ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #1996 from dongjoon-hyun/ORC-1753. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun
added a commit
that referenced
this pull request
Aug 5, 2024
### What changes were proposed in this pull request? This PR aims to use Apache Avro 1.12.0 in `bench` module. ### Why are the changes needed? Apache Avro 1.12.0 is the latest feature release. Since we are fixing this area recently, we had better keep it up-to-date in order to avoid re-validation in the future. - #1930 - #1995 ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #1996 from dongjoon-hyun/ORC-1753. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit e43ce79) Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR aims to fix
IllegalArgumentException
when reading json timestamp type in benchmark.Write and read json, convert timestamp type to long type instead of string type.
Why are the changes needed?
ORC-1191 Switch the csv format of taxi to parquet and read the timestamp format of parquet, but it is in microseconds format, which is different from the millisecond format of Java's
java.sql.Timestamp
.taxi source parquet meta
When we write the data into json and then use the scan command, we will get the following error.
Because json data of type timestamp is written via
java.sql.Timestamp#toString
, but reading the datajava.sql.Timestamp#valueOf
will report an error.How was this patch tested?
local test
java -jar core/target/orc-benchmarks-core-*-uber.jar generate data -format json -data taxi -compress snappy
java -jar core/target/orc-benchmarks-core-*-uber.jar scan data -format json -data taxi -compress snappy
Was this patch authored or co-authored using generative AI tooling?
No
Closes #1902