cxzl25 opened a new pull request, #1898:
URL: https://github.com/apache/orc/pull/1898

   ### What changes were proposed in this pull request?
   This PR aims to fix `ClassCastException` when reading avro decimal type in 
bechmark.
   
   ### Why are the changes needed?
   ORC-1191 Forcing `object` to `double`, but object type is `ByteBuffer`, 
which causes scan to fail.
   
   ```bash
    java -jar core/target/orc-benchmarks-core-*-uber.jar scan data
   ```
   
   ```java
   Exception in thread "main" java.lang.ClassCastException: class 
java.nio.HeapByteBuffer cannot be cast to class java.lang.Double 
(java.nio.HeapByteBuffer and java.lang.Double are in module java.base of loader 
'bootstrap')
        at 
org.apache.orc.bench.core.convert.avro.AvroReader$DecimalConverter.convert(AvroReader.java:204)
        at 
org.apache.orc.bench.core.convert.avro.AvroReader.nextBatch(AvroReader.java:69)
        at 
org.apache.orc.bench.core.convert.ScanVariants.run(ScanVariants.java:92)
        at org.apache.orc.bench.core.Driver.main(Driver.java:64)
   ```
   
   
   ### How was this patch tested?
   local test
   ```bash
    java -jar core/target/orc-benchmarks-core-*-uber.jar scan data
   ```
   output
   ```
   data/generated/taxi/avro.snappy rows: 22758236 batches: 22225
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to