fix: Java 8 compatibility for KMinSampling and benchmarks#817
Merged
SemyonSinchenko merged 9 commits intoMar 31, 2026
Conversation
…compat List.of() was added in Java 9 and breaks the release build on JDK 8 (Spark 3.5.x). Fixes graphframes#804.
JDK 8 was only tested during publish (push to main), so Java 8 incompatibilities like List.of() were not caught on PRs.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores Java 8 compatibility in the Scala core by removing usage of java.util.List.of() (Java 9+) and adds CI coverage for a Java 8 build variant to catch similar regressions earlier.
Changes:
- Replaced
java.util.List.of()withjava.util.Collections.emptyList()inKMinSamplingto avoid Java 9+ APIs. - Added a Java 8 entry to the Scala CI workflow matrix for Spark 3.5.x.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/src/main/scala/org/apache/spark/sql/graphframes/expressions/KMinSampling.scala | Swaps out Java 9+ List.of() for Java 8-compatible Collections.emptyList() when creating an empty DataFrame. |
| .github/workflows/scala-ci.yml | Adds a Spark 3.5.7 + Java 8 CI matrix entry to validate Java 8 compatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Path.of() was added in Java 11. Paths.get() is available since Java 7.
d6ecb99 to
2d28a64
Compare
LDBC test data downloads fail on JDK 8 due to Cloudflare TLS fingerprinting (JA3) rejecting Java 8's older TLS stack with 403. JDK 8 entry only needs to verify compilation; tests run on JDK 11/17.
This reverts commit 125f367.
… JDK 8 The LDBC CDN is behind Cloudflare, which uses TLS fingerprinting (JA3) to detect automated traffic. Java 8's TLS stack produces a distinctive fingerprint that Cloudflare rejects with HTTP 403. Java 11+ rewrote the TLS implementation (JEP 332) so its fingerprint is not flagged. Replace URLConnection with curl in both LDBCUtils and ParquetDataLoader. This is consistent with the existing use of shell commands (zstd, tar) in these files.
Per review: preserve the original download code so it can be restored after Spark 3.5.x EOL (~April 2026) when JDK 8 support is dropped.
SemyonSinchenko
approved these changes
Mar 31, 2026
This file contains hidden or 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
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.
Summary
java.util.List.of()inKMinSampling.scala→java.util.Collections.emptyList()(List.of added in Java 9)Path.of()inLDBCBenchmarkBase.scalaandLDBCBenchmarkSuite.scala→Paths.get()(Path.of added in Java 11)Fixes #804
Test plan
test (3.5.7, 8)job