Skip to content

java/driver/flight-sql: implement current catalog/current schema via session options #4573

Description

@unikdahal

Follow-up from #4444 review (comment by lidavidm).

The Go Flight SQL driver implements SetOption/current-catalog / current-schema by round-tripping through the session options API rather than being a local no-op:

// GetCurrentCatalog implements driverbase.CurrentNamespacer.
func (c *connectionImpl) GetCurrentCatalog() (string, error) {
options, err := c.getSessionOptions(context.Background())
if err != nil {
return "", err
}
if catalog, ok := options["catalog"]; ok {
if val, ok := catalog.(string); ok {
return val, nil
}
return "", c.Base().ErrorHelper.Errorf(adbc.StatusInternal, "server returned non-string catalog %#v", catalog)
}
return "", c.Base().ErrorHelper.Errorf(adbc.StatusNotFound, "current catalog not supported")
}

The Java driver's FlightSqlConnection should do the same: back adbc.connection.catalog / adbc.connection.db_schema (current catalog / current schema) with the server-side session, matching Go's behavior, instead of leaving them unimplemented/local-only.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions