wankunde opened a new pull request, #44351:
URL: https://github.com/apache/spark/pull/44351

   ### What changes were proposed in this pull request?
   
   Now spark will get a parquet binary object with getBytes() method.
   
   The **Binary.getBytes()** method will always make a new copy of the internal 
bytes.
   
   We can use **Binary.getBytesUnsafe()** method to get the cached bytes if it 
has already been called getBytes() and has the cached bytes.
   
   Local benchmark, before this PR:
   ```
   OpenJDK 64-Bit Server VM 17.0.6+10-LTS on Mac OS X 13.6
   Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
   Parquet dictionary:                       Best Time(ms)   Avg Time(ms)   
Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
   
------------------------------------------------------------------------------------------------------------------------
   Read binary dictionary                            18919          19449       
  393          5.5         180.4       1.0X
   ```
   after this PR:
   ```
   OpenJDK 64-Bit Server VM 17.0.6+10-LTS on Mac OS X 13.6
   Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
   Parquet dictionary:                       Best Time(ms)   Avg Time(ms)   
Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
   
------------------------------------------------------------------------------------------------------------------------
   Read binary dictionary                            10135          10602       
  337         10.3          96.7       1.0X
   
   ```
   
   ### Why are the changes needed?
   
   Optimize parquet reader.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   
   ### How was this patch tested?
   
   Local test
   
   ### 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to