You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-53118][CORE][TESTS] Use Files.write in GenericFileInputStreamSuite
### What changes were proposed in this pull request?
This PR aims to use `Files.write` instead of `FileUtils.writeByteArrayToFile` in the abstract test suite `GenericFileInputStreamSuite`. This will be used in the following two test cases.
- org.apache.spark.io.GenericFileInputStreamSuite
- org.apache.spark.io.NioBufferedInputStreamSuite
- org.apache.spark.io.ReadAheadInputStreamSuite
### Why are the changes needed?
This is the only place to use `FileUtils.writeByteArrayToFile` to write **2MB** byte array to generate a test input file. We had better use Java's native method for small test data usage.
https://github.com/apache/spark/blob/50882d2d88866ef0747ab7b542ac8ebaab4418ae/core/src/test/java/org/apache/spark/io/GenericFileInputStreamSuite.java#L37
### Does this PR introduce _any_ user-facing change?
This is a test only change.
### How was this patch tested?
Pass the CIs.
**BEFORE**
```
$ git grep FileUtils.writeByteArrayToFile
core/src/test/java/org/apache/spark/io/GenericFileInputStreamSuite.java: FileUtils.writeByteArrayToFile(inputFile, randomBytes);
```
**AFTER**
```
$ git grep FileUtils.writeByteArrayToFile
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#51837 from dongjoon-hyun/SPARK-53118.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
0 commit comments