awslabs / aws-athena-query-federation

The Amazon Athena Query Federation SDK allows you to customize Amazon Athena with your own data sources and code.
Apache License 2.0
557 stars 293 forks source link

[RFC] JDK 17 Upgrade & JDK LTS #2295

Open macohen opened 1 month ago

macohen commented 1 month ago

Is your feature request related to a problem? If yes, please describe. This project builds using JDK 8 and 11 today. Updating to JDK 17 would help modernize the connectors and create a clearer path to stay modern and update to the latest JDKs regularly.

Describe the solution you'd like

aimethed commented 1 month ago

Since we will still need to support JDK8, by my understanding we can't use features provided later than that? So we just need to make all the connectors compilable using JDK 17?

macohen commented 1 month ago

I think that's right, @aimethed. Until we can actually retire JDK8, we only need to build in JDK17.

abhishekpoddar-trianz commented 2 weeks ago

@macohen - could you please assign this ticket to me.

macohen commented 2 weeks ago

@abhishekpoddar-trianz, please ask any questions for clarification here. I think the priority is producing a build with JDK17. If we need to JDK features so it can run on a JDK8 VM instead of producing multiple builds, that's OK.

VenkatasivareddyTR commented 2 weeks ago

While building with JDK 17, build was failing with below error message: java.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.memory.util.MemoryUtil at org.apache.arrow.memory.ArrowBuf.setZero(ArrowBuf.java:1175)

We have fixed build issue by adding java environment variable to yaml file (JAVA_TOOL_OPTIONS: "--add-opens=java.base/java.nio=ALL-UNNAMED") as per the Apache Arrow recommendation https://arrow.apache.org/docs/java/install.html.

and we have added --add-opens=java.base/java.nio=ALL-UNNAMED to maven-surefire-plugin and maven-failsafe-plugin in pom.xml file as per the Apache Arrow recommendation https://arrow.apache.org/docs/java/install.html#java-install-maven-testing.

After adding these changes, we are able to build successfully. Now we are working on functional testing.

macohen commented 2 weeks ago

Fantastic. Adding @mschoeni1 to work on this with you as we move along.

macohen commented 2 weeks ago

Can you put up a draft PR with the changes made so far, please, @VenkatasivareddyTR?

VenkatasivareddyTR commented 2 weeks ago

@macohen Please find initial draft PR for JDK 17 upgrade. https://github.com/awslabs/aws-athena-query-federation/pull/2342

VenkatasivareddyTR commented 2 weeks ago

@macohen We have completed functional testing for 4 connectors i.e., PostgreSQL, DynamoDB, MSK, SQL Server and we didn't observe any issues. Please find attached test results for the same. Functional_Testing_Jdk17.xlsx

VenkatasivareddyTR commented 2 weeks ago

@macohen We have completed coding for jdk17 upgrade and published PR as well, can someone review it; We have done functional testing for 5 connectors i.e., PostgreSQL, DynamoDB, MSK, SQL Server, DocDB and build is successful for all connectors along with unit test cases. Functional_Testing_Jdk17_1.xlsx