Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Aug 8, 2025

What changes were proposed in this pull request?

This PR aims to use Java 9+ InputStream.readNBytes API instead of ByteStreams.read.

Why are the changes needed?

To simplify the code by using native Java API.

- var numBytes = ByteStreams.read(gzInputStream, buf, 0, bufSize)
+ var numBytes = gzInputStream.readNBytes(buf, 0, bufSize)

Does this PR introduce any user-facing change?

No behavior change.

How was this patch tested?

Pass the CIs.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun
Copy link
Member Author

Thank you, @yaooqinn .

@dongjoon-hyun
Copy link
Member Author

For this single file change, I verified manually like the following.

$ dev/lint-scala
Using SPARK_LOCAL_IP=localhost
Scalastyle checks passed.
Scalafmt checks passed.

$ build/sbt "core/testOnly *.UtilsSuite"
...
[info] Run completed in 3 seconds, 97 milliseconds.
[info] Total number of tests run: 61
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 61, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 20 s, completed Aug 8, 2025, 12:07:19 AM

@dongjoon-hyun
Copy link
Member Author

Merged to master. Thank you, @yaooqinn and @peter-toth .

@dongjoon-hyun dongjoon-hyun deleted the SPARK-53195 branch August 8, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants