Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlightSQL: Add helpers to create CommandGetXdbcTypeInfo responses (XdbcInfoValue and builders) #4257

Closed
alamb opened this issue May 22, 2023 · 1 comment · Fixed by #4359
Closed
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented May 22, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
FlightSQL has several metadata APIs for a server to report its capabilities to the client. One such API is the CommandGetXdbcTypeInfo message that requires creating a DenseUnion (which is somewhat inconvenient in the Rust API):

https://github.com/apache/arrow/blob/f9324b79bf4fc1ec7e97b32e3cce16e75ef0f5e3/format/FlightSql.proto#L1058-L1116

@roeap noted in #4250 (comment) that some of the existing work we did in IOx could be used by other rust projects implementing FlightSQL:

https://github.com/influxdata/influxdb_iox/blob/31b881376057bf7e50381519c4f5c9e15c1aee33/flightsql/src/xdbc_type_info/mod.rs

Describe the solution you'd like

  1. Create a builder for XdbcTypeInfo responses in the arrow-rs flightsql implementation: https://github.com/apache/arrow-rs/tree/master/arrow-flight/src/sql
  2. Create code that will convert these rust structs to the corresponding Arrow arrays
  3. Add tests and docstrings showing how to use this builder
  4. Update the example server
    async fn get_flight_info_xdbc_type_info(
    &self,
    _query: CommandGetXdbcTypeInfo,
    _request: Request<FlightDescriptor>,
    ) -> Result<Response<FlightInfo>, Status> {
    Err(Status::unimplemented(
    "get_flight_info_xdbc_type_info not implemented",
    ))
    }
    to use this XdbcTypeInfoBuilder

I suggest following the model / copying code from IOx's [XdbcTypeInfo]:

https://github.com/influxdata/influxdb_iox/blob/31b881376057bf7e50381519c4f5c9e15c1aee33/flightsql/src/xdbc_type_info/value.rs#L146C16-L171

Describe alternatives you've considered

Additional context
Marking this as a good first issue as it is well specified and the implementation already exists for inspiration

@alamb alamb added good first issue Good for newcomers arrow-flight Changes to the arrow-flight crate enhancement Any new improvement worthy of a entry in the changelog labels May 22, 2023
@alamb alamb changed the title FlightSQL: Add helpers to create CommandGetXdbcTypeInfo responses (SqlInfoValue and builders) FlightSQL: Add helpers to create CommandGetXdbcTypeInfo responses (XdbcInfoValue and builders) May 22, 2023
@alamb alamb added the arrow Changes to the arrow crate label Jun 16, 2023
@alamb
Copy link
Contributor Author

alamb commented Jun 16, 2023

label_issue.py automatically added labels {'arrow'} from #4250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant