New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KYUUBI #5314] Support JDK 21 #6306
base: master
Are you sure you want to change the base?
Conversation
pom.xml
Outdated
-Dio.netty.tryReflectionSetAccessible=true</maven.plugin.surefire.argLine> | ||
<!-- Current google format does not run on Java 21. | ||
Don't upgrade it in this profile because it formats code differently. | ||
Re-evaluate once support for Java 8 is dropped. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we recover it by overriding <spotless.java.googlejavaformat.version>
in this profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if using a new version of googleJavaFormat
for code formatting check under Java 21, one problem is that this would cause some existing code formatting checks to fail, like this:
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:check (default) on project kyuubi-hive-jdbc: The following files had format violations:
[ERROR] src/main/java/org/apache/kyuubi/jdbc/KyuubiDriver.java
[ERROR] @@ -17,6 +17,8 @@
[ERROR]
[ERROR] package·org.apache.kyuubi.jdbc;
[ERROR]
[ERROR] -/**·@deprecated·Use·`KyuubiHiveDriver`·instead.·*/
[ERROR] +/**
[ERROR] +·*·@deprecated·Use·`KyuubiHiveDriver`·instead.
[ERROR] +·*/
[ERROR] @Deprecated
[ERROR] public·class·KyuubiDriver·extends·KyuubiHiveDriver·{}
If set check
to apply
, in which case it would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we accepts those changes, will the Java8 with old googleJavaFormat
be happy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take some tests using both Java 8 and Java 21, and then report back here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I upgraded the versions of spotless
and googlejavaformat
in the java21 profile and manually executed mvn spotless:apply
, some code formats were adjusted by spotless
.
But when I switched to Java8 with old googlejavaformat
for checking, errors occurred. It seems that the rules of the new version of googlejavaformat
are not compatible with the old version. Perhaps before we drop support for Java8, we can only skip spotless's check in Java21. Once we abandon support for Java8, we can upgrade the versions of spotless and googlejavaformat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for investigating, let's leave a brief comment to explain the decision, i.e. "Skip Java formatting because Java 21 requires a new version of googlejavaformat, but the format rules conflict with the existing one"
Oh, you already did that
<maven.compiler.source></maven.compiler.source> | ||
<maven.compiler.target></maven.compiler.target> | ||
<maven.compiler.release>${java.version}</maven.compiler.release> | ||
<maven.plugin.surefire.argLine>-XX:+IgnoreUnrecognizedVMOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, we can set this property unconditionally, instead of duplicating it in different profiles
I merged your arrow upgrading PR, please rebase this PR on master, and add a CI coverage for Java 21 |
Thanks, I will synchronize from the master branch. |
@dupen01 you don't need to recreate new PR, just sync the master branch and perform |
Sorry, accidentally clicked Close; please kindly reopen. |
you can add the following part to
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6306 +/- ##
============================================
- Coverage 58.47% 58.41% -0.07%
Complexity 24 24
============================================
Files 652 652
Lines 39645 39645
Branches 5454 5454
============================================
- Hits 23181 23157 -24
- Misses 13984 13995 +11
- Partials 2480 2493 +13 ☔ View full report in Codecov by Sentry. |
My new submission includes other PR commit, and I'm not sure if there are any conflicts. Could you please review it for me? I apologize for any inconvenience this may cause you. |
Git is a little bit confusing for new contributors, I hope the following article and tool helps you to learn it. [1] https://dev.to/lydiahallie/cs-visualized-useful-git-commands-37p1 |
looks additional module export is required |
I reproduced the exception, and it appears to be caused by the configuration in the
|
Hi, @pan3793.
Analysis:
After re-executing the Scala Test (2.13, 8, 3.5) workflow, it succeeded.
Analysis: |
🔍 Description
Issue References 🔗
This pull request fixes #5314
Describe Your Solution 🔧
To support Java 21, it would be necessary to upgrade the
spotless-maven-plugin
to a more recent version, such as from 2.30.0 to 2.43.0, as per diffplug/spotless#1819.Correspondingly,
googlejavaformat
would also need to be upgraded, which would result in the loss of support for Java 8 (as documented in https://github.com/diffplug/spotless/blob/main/plugin-maven/README.md). This upgrade would cause some existing code formatting checks to fail.Drawing inspiration from the Apache Flink community's approach, I propose skipping the
spotless-maven-plugin
's check behavior injava-21
profile. Once the Kyuubi community decides to drop support for Java 8, upgrading bothspotless-maven-plugin
andgooglejavaformat
to their newer versions could then be considered.Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Executed
mvn clean package -DskipTests
locally under a JDK 21 environment, with no exceptions encountered.Packaged into a tar file and did some basic Spark engine test on my Mac, no exceptions were observed.
Related Unit Tests
Checklist 📝
Be nice. Be informative.