Skip to content
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

GH-34742: [Java] Split flight-sql-jdbc-driver to facilitate reuse #34678

Merged
merged 4 commits into from
Mar 27, 2023

Conversation

wgtmac
Copy link
Member

@wgtmac wgtmac commented Mar 22, 2023

Rationale for this change

flight-sql-jdbc-driver module contains a set of utilities to implement JDBC support backed by arrow vectors. However, it employs maven shade plugin which is hard to make it a dependecy of external projects.

What changes are included in this PR?

This patch splits flight-sql-jdbc-driver module into two separate modules: flight-sql-jdbc-core and flight-sql-jdbc-driver. flight-sql-jdbc-core contains almost every thing in the original module except the shade plugin. flight-sql-jdbc-driver only shades flight-sql-jdbc-core.

Are these changes tested?

Make sure all tests pass.

Are there any user-facing changes?

No.

@wgtmac wgtmac requested a review from lidavidm as a code owner March 22, 2023 06:51
@github-actions
Copy link

@github-actions
Copy link

⚠️ GitHub issue apache/arrow-java#363 has been automatically assigned in GitHub to PR creator.

  flight-sql-jdbc-driver module contains a set of utilities to
  implement JDBC support backed by arrow vectors. However, it
  employs maven shade plugin which is hard to use. This patch
  splits it into two separate modules.
@wgtmac
Copy link
Member Author

wgtmac commented Mar 22, 2023

@lidavidm Could you please take a look? Thanks!

@lidavidm
Copy link
Member

@davisusanibar or @lwhite1 would either of you be able to take a first pass?

Also,

arrow/dev/tasks/tasks.yml

Lines 799 to 803 in ce0d20c

java-jars:
# Build jar's that contains cpp libraries dependencies
ci: github
template: java-jars/github.yml
artifacts:
needs to be updated with new artifacts

@wgtmac
Copy link
Member Author

wgtmac commented Mar 23, 2023

arrow/dev/tasks/tasks.yml

Lines 799 to 803 in ce0d20c

java-jars:
# Build jar's that contains cpp libraries dependencies
ci: github
template: java-jars/github.yml
artifacts:

needs to be updated with new artifacts

Fixed tasks.yml, thanks @lidavidm!

BTW, though this PR looks very large by affecting hundreds of files, it contains only 200- lines of change as mostly are file relocation.

@assignUser
Copy link
Member

assignUser commented Mar 23, 2023

@github-actions crossbow submit java-jars

@github-actions
Copy link

Revision: d382b46

Submitted crossbow builds: ursacomputing/crossbow @ actions-5a76b30651

Task Status
java-jars Github Actions

@wgtmac
Copy link
Member Author

wgtmac commented Mar 23, 2023

Revision: d382b46

Submitted crossbow builds: ursacomputing/crossbow @ actions-5a76b30651

Task Status
java-jars Github Actions

                  flight-sql-jdbc-core-12.0.0-SNAPSHOT-cyclonedx.json [     OK]
                   flight-sql-jdbc-core-12.0.0-SNAPSHOT-cyclonedx.xml [     OK]
                     flight-sql-jdbc-core-12.0.0-SNAPSHOT-javadoc.jar [     OK]
                     flight-sql-jdbc-core-12.0.0-SNAPSHOT-sources.jar [     OK]
                       flight-sql-jdbc-core-12.0.0-SNAPSHOT-tests.jar [     OK]
                             flight-sql-jdbc-core-12.0.0-SNAPSHOT.jar [     OK]
                             flight-sql-jdbc-core-12.0.0-SNAPSHOT.pom [     OK]
                flight-sql-jdbc-driver-12.0.0-SNAPSHOT-cyclonedx.json [     OK]
                 flight-sql-jdbc-driver-12.0.0-SNAPSHOT-cyclonedx.xml [     OK]
                   flight-sql-jdbc-driver-12.0.0-SNAPSHOT-javadoc.jar [PENDING]
                   flight-sql-jdbc-driver-12.0.0-SNAPSHOT-sources.jar [     OK]
                     flight-sql-jdbc-driver-12.0.0-SNAPSHOT-tests.jar [     OK]
                           flight-sql-jdbc-driver-12.0.0-SNAPSHOT.jar [     OK]
                           flight-sql-jdbc-driver-12.0.0-SNAPSHOT.pom [     OK]
Error: Process completed with exit code 1.

flight-sql-jdbc-driver will not create flight-sql-jdbc-driver-12.0.0-SNAPSHOT-javadoc.jar because it only shades flight-sql-jdbc-core. So I removed it from tasks.yml.

@assignUser Should we rerun the crossbow build?

@github-actions
Copy link

Revision: 7067c95

Submitted crossbow builds: ursacomputing/crossbow @ actions-c5e181f11b

Task Status
java-jars Github Actions

@wgtmac
Copy link
Member Author

wgtmac commented Mar 23, 2023

Revision: 7067c95

Submitted crossbow builds: ursacomputing/crossbow @ actions-c5e181f11b

Task Status
java-jars Github Actions

Downloaded from apache: https://repo.maven.apache.org/maven2/com/google/guava/guava-parent/19.0/guava-parent-19.0.pom (9.9 kB at 1.2 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Arrow Java Root POM 12.0.0-SNAPSHOT:
[INFO] 
[INFO] Apache Arrow Java Root POM ......................... SUCCESS [ 45.069 s]
[INFO] Arrow Format ....................................... SUCCESS [ 16.880 s]
[INFO] Arrow Memory ....................................... SUCCESS [  5.681 s]
[INFO] Arrow Memory - Core ................................ SUCCESS [ 26.060 s]
[INFO] Arrow Memory - Unsafe .............................. SUCCESS [ 12.697 s]
[INFO] Arrow Memory - Netty ............................... SUCCESS [ 18.038 s]
[INFO] Arrow Vectors ...................................... FAILURE [10:15 min]
[INFO] Arrow Compression .................................. SKIPPED
[INFO] Arrow Tools ........................................ SKIPPED
[INFO] Arrow JDBC Adapter ................................. SKIPPED
[INFO] Arrow Plasma Client ................................ SKIPPED
[INFO] Arrow Flight ....................................... SKIPPED
[INFO] Arrow Flight Core .................................. SKIPPED
[INFO] Arrow Flight GRPC .................................. SKIPPED
[INFO] Arrow Flight SQL ................................... SKIPPED
[INFO] Arrow Flight SQL JDBC Driver Core .................. SKIPPED
[INFO] Arrow Flight SQL JDBC Driver ....................... SKIPPED
[INFO] Arrow Flight Integration Tests ..................... SKIPPED
[INFO] Arrow AVRO Adapter ................................. SKIPPED
[INFO] Arrow Algorithms ................................... SKIPPED
[INFO] Arrow Performance Benchmarks ....................... SKIPPED
[INFO] Arrow Java C Data Interface ........................ SKIPPED
[INFO] Arrow Orc Adapter .................................. SKIPPED
[INFO] Arrow Gandiva ...................................... SKIPPED
[INFO] Arrow Java Dataset ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12:21 min
[INFO] Finished at: 2023-03-23T06:29:00Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.1:shade (default) on project arrow-vector: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:3.1.1:shade failed: Plugin org.apache.maven.plugins:maven-shade-plugin:3.1.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-shade-plugin:jar:3.1.1 -> org.ow2.asm:asm:jar:6.0: Failed to read artifact descriptor for org.ow2.asm:asm:jar:6.0: Could not transfer artifact org.ow2.asm:asm:pom:6.0 from/to apache (https://repo.maven.apache.org/maven2/): Connection reset -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Error:  
Error:  After correcting the problems, you can resume the build with the command
Error:    mvn <args> -rf :arrow-vector
Error: Process completed with exit code 1.

Failure is in arrow-vector which seems unrelated.

@kou
Copy link
Member

kou commented Mar 24, 2023

I re-ran the job and the job passed. :-)

@wgtmac
Copy link
Member Author

wgtmac commented Mar 24, 2023

cc @sunchao :)

Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

+1 on CI changes, can't comment on the rest :)

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Mar 24, 2023
Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

Makes sense. It seems currently flight-sql-jdbc-driver just shade everything so it's difficult for downstream projects to manage dependencies (e.g., exclude certain dependency from flight-sql-jdbc-driver).

I'm not a regular reviewer for Arrow-Java though so it's better for @lidavidm to make the final call.

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Mar 24, 2023
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

LGTM. However, our testing of the driver artifact itself is nonexistent. We should consider setting up a job that takes the built driver JAR and runs it against the dremio-oss Docker container or similar.


<artifactId>flight-sql-jdbc-core</artifactId>
<name>Arrow Flight SQL JDBC Driver Core</name>
<description>(Contrib/Experimental) A JDBC driver based on Arrow Flight SQL.</description>
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we update this to reflect that this isn't the actual driver?

Copy link
Member Author

Choose a reason for hiding this comment

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

Slightly modified the description. Please correct me if there is any better description.

@wgtmac wgtmac requested review from lidavidm and removed request for kou and raulcd March 26, 2023 14:20
@wgtmac
Copy link
Member Author

wgtmac commented Mar 27, 2023

Do you have any idea why the flight-sql-jdbc-core test is easy to fail? @lidavidm

https://github.com/apache/arrow/actions/runs/4527686135/jobs/7973768071?pr=34678

@lidavidm
Copy link
Member

The test probably needs some debugging, but I have very little time for Java work these days (it's mostly on my personal time). There haven't been substantial contributions to the driver since its initial contribution.

@wgtmac
Copy link
Member Author

wgtmac commented Mar 27, 2023

The test probably needs some debugging, but I have very little time for Java work these days (it's mostly on my personal time). There haven't been substantial contributions to the driver since its initial contribution.

I tried to debug it but cannot reproduce on my Mac. It seems to be unstable and now the tests are all green.

@lidavidm
Copy link
Member

Thanks for looking. I filed apache/arrow-java#210 for anyone who wants to follow up.

@lidavidm
Copy link
Member

I'll open a new issue for this, because the original issue is quite different.

@lidavidm lidavidm changed the title GH-20730: [Java] Split flight-sql-jdbc-driver to facilitate reuse GH-34742: [Java] Split flight-sql-jdbc-driver to facilitate reuse Mar 27, 2023
@github-actions
Copy link

@github-actions
Copy link

⚠️ GitHub issue #34742 has been automatically assigned in GitHub to PR creator.

@lidavidm lidavidm merged commit eaa1a1e into apache:main Mar 27, 2023
@ursabot
Copy link

ursabot commented Mar 27, 2023

Benchmark runs are scheduled for baseline = 0a21a4c and contender = eaa1a1e. eaa1a1e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️0.33% ⬆️0.0%] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Failed ⬇️0.0% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] eaa1a1ea ec2-t3-xlarge-us-east-2
[Failed] eaa1a1ea test-mac-arm
[Finished] eaa1a1ea ursa-i9-9960x
[Failed] eaa1a1ea ursa-thinkcentre-m75q
[Finished] 0a21a4c2 ec2-t3-xlarge-us-east-2
[Failed] 0a21a4c2 test-mac-arm
[Finished] 0a21a4c2 ursa-i9-9960x
[Finished] 0a21a4c2 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
…se (apache#34678)

### Rationale for this change

`flight-sql-jdbc-driver` module contains a set of utilities to implement JDBC support backed by arrow vectors. However, it employs maven shade plugin which is hard to make it a dependecy of external projects.

### What changes are included in this PR?

This patch splits `flight-sql-jdbc-driver` module into two separate modules: `flight-sql-jdbc-core` and `flight-sql-jdbc-driver`. `flight-sql-jdbc-core` contains almost every thing in the original module except the shade plugin. `flight-sql-jdbc-driver` only shades `flight-sql-jdbc-core`.

### Are these changes tested?

Make sure all tests pass.

### Are there any user-facing changes?

No.
* Closes: #20730
* Closes: apache#34742

Authored-by: Gang Wu <ustcwg@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Copy link

⚠️ GitHub issue #34742 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Java] Arrow-to-JDBC [Java] Split flight-sql-jdbc-driver to allow reuse of some internals
6 participants