Skip to content

feat(java/driver/jni): implement getStatistics - #4361

Merged
lidavidm merged 2 commits into
apache:mainfrom
lidavidm:jni-statistics
Jun 5, 2026
Merged

feat(java/driver/jni): implement getStatistics#4361
lidavidm merged 2 commits into
apache:mainfrom
lidavidm:jni-statistics

Conversation

@lidavidm

@lidavidm lidavidm commented Jun 4, 2026

Copy link
Copy Markdown
Member

Closes #4360.

@lidavidm
lidavidm requested review from amoeba, Copilot and zeroshade and removed request for zeroshade June 4, 2026 04:02

Copilot AI left a comment

Copy link
Copy Markdown

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 enables the ADBC getStatistics() / getStatisticNames() metadata APIs in the Java JNI driver by wiring the Java AdbcConnection methods through the JNI layer to the underlying C driver implementations, and adds PostgreSQL integration coverage to validate the new bindings.

Changes:

  • Implement AdbcConnection#getStatistics(...) and AdbcConnection#getStatisticNames() in JniConnection.
  • Add JNI-native method declarations and loader wrappers for both APIs.
  • Implement the JNI C++ wrappers that call AdbcConnectionGetStatistics / AdbcConnectionGetStatisticNames, plus add Postgres integration tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/JniConnection.java Adds getStatistics and getStatisticNames overrides that import native streams into an ArrowReader.
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/impl/NativeAdbc.java Declares the new native entry points for statistics APIs.
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/impl/JniLoader.java Adds safe wrapper methods around the new NativeAdbc calls.
java/driver/jni/src/main/cpp/jni_wrapper.cc Implements JNI glue for connectionGetStatistics and connectionGetStatisticNames.
java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/PostgresIntegrationTest.java Adds integration tests covering both new connection APIs against PostgreSQL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lidavidm
lidavidm marked this pull request as ready for review June 4, 2026 06:19
@lidavidm
lidavidm merged commit b6ce567 into apache:main Jun 5, 2026
15 of 16 checks passed
@lidavidm
lidavidm deleted the jni-statistics branch June 5, 2026 21:40
@lidavidm lidavidm added this to the ADBC Libraries 24 milestone Jul 22, 2026
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.

java/driver/jni: enable getStatistics

3 participants