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

Update FlightSQL metadata locations, names and docs #4341

Merged
merged 4 commits into from
Jun 2, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jun 1, 2023

Which issue does this PR close?

This is a follow on to #4296 from @roeap and related to #4295

Rationale for this change

Since we haven't released these APIs yet and now that we have several metadata builders I wanted to put them in a unified location in the flight sql implementation

What changes are included in this PR?

  1. Move all the metadata builders into the sql::metadata module
  2. Reduce the API surface by moving schema() to methods on the builders
  3. Update and add some more docstrings

Are there any user-facing changes?

@github-actions github-actions bot added arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate labels Jun 1, 2023
@@ -1,123 +0,0 @@
// Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to metadata/mod.rs

@@ -27,7 +27,7 @@
//! 2. Helpers for encoding and decoding FlightSQL messages: [`Any`] and [`Command`]
//! 3. A [`FlightSqlServiceClient`] for interacting with FlightSQL servers.
//! 4. A [`FlightSqlService`] to help building FlightSQL servers from [`FlightService`].
//! 5. Structures to build responses for FlightSQL metadata APIs: [`SqlInfoList`]
//! 5. Helpers to build responses for FlightSQL metadata APIs: [`metadata`]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the docs now look more unified and lead people to the metadata crate more easily


pub use catalogs::GetCatalogsBuilder;
pub use db_schemas::GetDbSchemasBuilder;
pub use sql_info::SqlInfoList;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow on it would be awesome to make a SqlInfoList builder similarly to the other builders, but I ran out of time today and figured I will do it as a follow on PR

@alamb alamb requested a review from avantgardnerio June 1, 2023 21:08
@alamb
Copy link
Contributor Author

alamb commented Jun 1, 2023

@tustvold if possible it would be great to get this PR into the release

@tustvold
Copy link
Contributor

tustvold commented Jun 2, 2023

CI appears to be failing for this?

@alamb
Copy link
Contributor Author

alamb commented Jun 2, 2023

Fixing...

@@ -252,7 +249,7 @@ impl FlightSqlService for FlightSqlServiceImpl {
let endpoint = FlightEndpoint::new().with_ticket(ticket);

let flight_info = FlightInfo::new()
.try_with_schema(get_catalogs_schema())
.try_with_schema(&query.into_builder().schema())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning the query into a builder is so beautiful -- it was a great idea @roeap

/// Builds rows like this:
///
/// * catalog_name: utf8,
/// * db_schema_name: utf8,
pub struct GetSchemasBuilder {
pub struct GetDbSchemasBuilder {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to follow the name of the flightSQL request struct (which has a strange Db in it 🤷 )

@alamb
Copy link
Contributor Author

alamb commented Jun 2, 2023

I am going to take the liberty of merging this PR to get it into the release. We can refine the APIs later but I would like to avoid API churn as much as possible (and this is API churn, but on an unreleased API)

@alamb alamb merged commit 0a32590 into apache:master Jun 2, 2023
@alamb alamb deleted the alamb/consolidate_metadata branch June 2, 2023 11:06
@alamb alamb self-assigned this Jun 2, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants