Skip to content

fix: Java 8 compatibility for KMinSampling and benchmarks#817

Merged
SemyonSinchenko merged 9 commits into
graphframes:mainfrom
james-willis:fix/java8-list-of
Mar 31, 2026
Merged

fix: Java 8 compatibility for KMinSampling and benchmarks#817
SemyonSinchenko merged 9 commits into
graphframes:mainfrom
james-willis:fix/java8-list-of

Conversation

@james-willis
Copy link
Copy Markdown
Collaborator

@james-willis james-willis commented Mar 30, 2026

Summary

  • java.util.List.of() in KMinSampling.scalajava.util.Collections.emptyList() (List.of added in Java 9)
  • Path.of() in LDBCBenchmarkBase.scala and LDBCBenchmarkSuite.scalaPaths.get() (Path.of added in Java 11)
  • Adds JDK 8 to the Scala CI matrix so these regressions are caught on PRs, not just during release

Fixes #804

Test plan

  • CI passes on test (3.5.7, 8) job

…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() with java.util.Collections.emptyList() in KMinSampling to 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.

Comment thread .github/workflows/scala-ci.yml
Path.of() was added in Java 11. Paths.get() is available since Java 7.
@james-willis james-willis changed the title fix: replace List.of with Collections.emptyList for Java 8 compat fix: Java 8 compatibility for KMinSampling and benchmarks Mar 30, 2026
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.
… 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 SemyonSinchenko merged commit d34195e into graphframes:main Mar 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: java8 compatibility

3 participants