Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Java][FlightRPC] Flight SQL JDBC driver does not expose per-batch app_metadata from FlightStream

Open
#1,089 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
75/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java, sql
Domain
api, database

Research direction

Start with ArrowFlightJdbcFlightStreamResultSet and its existing getAppMetadata() method, then trace currentEndpointData and FlightStream.getLatestMetadata(). Done means JDBC callers can use unwrap() to retrieve the latest per-batch metadata, including trailing metadata from the final batch, without accessing the raw FlightClient.

Written by the indexing model from the issue text.

Description

Type: enhancement
Summary

The Flight SQL JDBC driver (flight-sql-jdbc-driver) currently exposes FlightInfo.app_metadata via ArrowFlightJdbcFlightStreamResultSet.getAppMetadata() (added in ~15.0), but per-batch app_metadata from FlightStream.getLatestMetadata() is received internally and silently discarded — it is never surfaced to JDBC callers.

Motivation

Servers use per-batch app_metadata on FlightData messages to communicate execution statistics (rows scanned, elapsed time, query state, etc.) — similar to what Trino exposes via QueryStats. This is particularly valuable for the final batch, which servers commonly use as a "trailing metadata" pattern to report post-execution stats.
Currently there is no way to access this information through the JDBC layer without dropping down to the raw FlightClient, which defeats the purpose of the JDBC driver abstraction.

Current behavior

FlightInfo.app_metadata → accessible via rs.unwrap(ArrowFlightJdbcFlightStreamResultSet.class).getAppMetadata() ✅
Per-batch FlightData.app_metadata → received by FlightStream.getLatestMetadata() internally, but never stored or exposed ❌

Also worth noting: getAppMetadata() returns a snapshot from query submission time only. For long-running queries using PollFlightInfo, updated app_metadata from subsequent poll cycles is never surfaced. This limits its usefulness for engines that progressively update stats during execution.

Requested change

Add a method to ArrowFlightJdbcFlightStreamResultSet (accessible via unwrap()) such as:

public ArrowBuf getLatestBatchMetadata() {
    if (currentEndpointData == null || currentEndpointData.getStream() == null) {
        return null;
    }
    return currentEndpointData.getStream().getLatestMetadata();
}

This would follow the same unwrap() pattern already established for getAppMetadata() and give callers access to per-batch metadata, including trailing stats on the final batch.

Component(s)

FlightRPC, Java

Dominant language
Java
Stars
95
Forks
154
Avg merge
2d 10h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-java

All issues in apache/arrow-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.