unikdahal opened a new pull request, #4444:
URL: https://github.com/apache/arrow-adbc/pull/4444
## Summary
Implements Flight SQL session management in the Java ADBC driver,
bringing parity with the Go/Python drivers. Relates to #745. Closes
#4443.
### Changes
**`FlightSqlConnectionProperties`** — adds five string constants for
session option key prefixes:
- `adbc.flight.sql.session.option.` (string/long/double)
- `adbc.flight.sql.session.optionbool.` (boolean)
- `adbc.flight.sql.session.optionstringlist.` (String[]; JSON string
also accepted for cross-language compat)
- `adbc.flight.sql.session.optionerase.` (erase an option)
- `adbc.flight.sql.session.options` (read-only JSON blob of all options)
**`FlightSqlClientWithCallOptions`** — adds `setSessionOptions`,
`getSessionOptions`, and `closeSession` delegation methods following the
existing `combine(callOptions)` pattern.
**`FlightSqlConnection`** — overrides `getOption`/`setOption` for all
session prefixes with typed dispatch via `TypedKey<T>`:
- `null` value rejected early with `INVALID_ARGUMENT`
- Empty option name caught before the RPC with `INVALID_ARGUMENT`
- `Long`/`Double` parse errors wrapped in `AdbcException` instead of
leaking `NumberFormatException`
- `close()` sends `CloseSession` best-effort; catches only
`FlightRuntimeException` so `InterruptedException` is never swallowed
**`FlightSqlSessionUtil`** _(new class)_ — package-private utility
holding all JSON helpers and typed `SessionOptionValue` visitors,
extracted from `FlightSqlConnection` to keep the connection class
focused on the ADBC surface:
- `escapeJson` covers the full U+0000–U+001F control-character range
- `parseJsonArray` handles `\uXXXX`, `\b`, `\f`, and all JSON
whitespace (not just ASCII space)
- `JSON_VALUE_VISITOR` emits `"null"` for `NaN`/`Infinity` doubles to
produce valid RFC 8259 output
**`FlightSqlSessionTest`** _(new tests)_ — 8 unit tests using an
in-process `FlightSqlProducer` with real in-memory session state,
covering: string/bool/string-list set+get, erase, the full
`SESSION_OPTIONS` JSON blob, `CloseSession` called on `close()`,
read-only blob rejection, and graceful close when server returns
produce valid RFC 8259 output
**`FlightSqlSessionTest`** _(new tests)_ — 8 unit tests using an
in-process `FlightSqlProducer` with real in-memory session state,
covering: string/bool/string-list set+get, erase, the full
`SESSION_OPTIONS` JSON blob, `CloseSession` called on `close()`,
read-only blob rejection, and graceful close when server returns
`UNIMPLEMENTED`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]