unikdahal commented on code in PR #4444:
URL: https://github.com/apache/arrow-adbc/pull/4444#discussion_r3566978338
##########
java/driver/flight-sql/src/main/java/org/apache/arrow/adbc/driver/flightsql/FlightSqlConnection.java:
##########
@@ -203,17 +212,167 @@ public void setAutoCommit(boolean enableAutoCommit)
throws AdbcException {
}
}
+ @Override
+ public <T> T getOption(TypedKey<T> key) throws AdbcException {
+ final String k = key.getKey();
+
+ if (k.equals(FlightSqlConnectionProperties.SESSION_OPTIONS)) {
+ if (key.getType() != String.class) {
+ return AdbcConnection.super.getOption(key);
+ }
+ return
key.cast(FlightSqlSessionUtil.toJson(fetchSessionOptionsOrEmpty()));
+ }
+
+ final String prefix;
+ if
(k.startsWith(FlightSqlConnectionProperties.SESSION_OPTION_BOOL_PREFIX)) {
+ prefix = FlightSqlConnectionProperties.SESSION_OPTION_BOOL_PREFIX;
+ } else if
(k.startsWith(FlightSqlConnectionProperties.SESSION_OPTION_STRING_LIST_PREFIX))
{
+ prefix = FlightSqlConnectionProperties.SESSION_OPTION_STRING_LIST_PREFIX;
+ } else if
(k.startsWith(FlightSqlConnectionProperties.SESSION_OPTION_PREFIX)) {
+ prefix = FlightSqlConnectionProperties.SESSION_OPTION_PREFIX;
+ } else {
+ return AdbcConnection.super.getOption(key);
+ }
+
+ final String name = k.substring(prefix.length());
+ if (name.isEmpty()) {
+ throw AdbcException.invalidArgument("[Flight SQL] Session option name
must not be empty");
+ }
+ final Object raw =
+ FlightSqlSessionUtil.require(fetchSessionOptions(), name)
Review Comment:
switched to fetchSessionOptionsOrEmpty() and removed the unused
fetchSessionOptions method
--
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]