alamb commented on code in PR #4341:
URL: https://github.com/apache/arrow-rs/pull/4341#discussion_r1214217754
##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -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())
Review Comment:
Turning the query into a builder is so beautiful -- it was a great idea
@roeap
##########
arrow-flight/src/sql/metadata/db_schemas.rs:
##########
@@ -33,26 +33,13 @@ use super::lexsort_to_indices;
use crate::error::*;
use crate::sql::CommandGetDbSchemas;
-/// Return the schema of the RecordBatch that will be returned from
[`CommandGetDbSchemas`]
+/// A builder for a [`CommandGetDbSchemas`] response.
///
-/// [`CommandGetDbSchemas`]: crate::sql::CommandGetDbSchemas
-pub fn get_db_schemas_schema() -> SchemaRef {
- Arc::clone(&GET_DB_SCHEMAS_SCHEMA)
-}
-
-/// The schema for GetDbSchemas
-static GET_DB_SCHEMAS_SCHEMA: Lazy<SchemaRef> = Lazy::new(|| {
- Arc::new(Schema::new(vec![
- Field::new("catalog_name", DataType::Utf8, false),
- Field::new("db_schema_name", DataType::Utf8, false),
- ]))
-});
-
/// Builds rows like this:
///
/// * catalog_name: utf8,
/// * db_schema_name: utf8,
-pub struct GetSchemasBuilder {
+pub struct GetDbSchemasBuilder {
Review Comment:
renamed to follow the name of the flightSQL request struct (which has a
strange `Db` in it 🤷 )
--
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]