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

Pass pull Request<FlightDescriptor> to FlightSqlService impls #2309

Merged
merged 4 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 83 additions & 27 deletions arrow-flight/examples/flight_sql_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use arrow_flight::sql::{ActionCreatePreparedStatementResult, SqlInfo};
use arrow_flight::{FlightData, HandshakeRequest, HandshakeResponse};
use futures::Stream;
use std::pin::Pin;
use tonic::metadata::MetadataMap;
use tonic::transport::Server;
use tonic::{Request, Response, Status, Streaming};

Expand Down Expand Up @@ -93,179 +94,234 @@ impl FlightSqlService for FlightSqlServiceImpl {
async fn get_flight_info_statement(
&self,
_query: CommandStatementQuery,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_statement not implemented",
))
}

async fn get_flight_info_prepared_statement(
&self,
_query: CommandPreparedStatementQuery,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_prepared_statement not implemented",
))
}

async fn get_flight_info_catalogs(
&self,
_query: CommandGetCatalogs,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_catalogs not implemented",
))
}

async fn get_flight_info_schemas(
&self,
_query: CommandGetDbSchemas,
_request: FlightDescriptor,
_query: CommandGetSqlInfo,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_schemas not implemented",
))
}

async fn get_flight_info_tables(
&self,
_query: CommandGetTables,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_tables not implemented",
))
}

async fn get_flight_info_table_types(
&self,
_query: CommandGetTableTypes,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_table_types not implemented",
))
}

async fn get_flight_info_sql_info(
&self,
_query: CommandGetSqlInfo,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_sql_info not implemented",
))
}

async fn get_flight_info_primary_keys(
&self,
_query: CommandGetPrimaryKeys,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_primary_keys not implemented",
))
}

async fn get_flight_info_exported_keys(
&self,
_query: CommandGetExportedKeys,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_exported_keys not implemented",
))
}

async fn get_flight_info_imported_keys(
&self,
_query: CommandGetImportedKeys,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_imported_keys not implemented",
))
}

async fn get_flight_info_cross_reference(
&self,
_query: CommandGetCrossReference,
_request: FlightDescriptor,
_request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"get_flight_info_imported_keys not implemented",
))
}

// do_get
async fn do_get_statement(
&self,
_ticket: TicketStatementQuery,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}

async fn do_get_prepared_statement(
&self,
_query: CommandPreparedStatementQuery,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_catalogs(
&self,
_query: CommandGetCatalogs,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_schemas(
&self,
_query: CommandGetDbSchemas,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_tables(
&self,
_query: CommandGetTables,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_table_types(
&self,
_query: CommandGetTableTypes,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_sql_info(
&self,
_query: CommandGetSqlInfo,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_primary_keys(
&self,
_query: CommandGetPrimaryKeys,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_exported_keys(
&self,
_query: CommandGetExportedKeys,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_imported_keys(
&self,
_query: CommandGetImportedKeys,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_get_cross_reference(
&self,
_query: CommandGetCrossReference,
_metadata: MetadataMap,
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
}

// do_put
async fn do_put_statement_update(
&self,
_ticket: CommandStatementUpdate,
_metadata: MetadataMap,
) -> Result<i64, Status> {
Err(Status::unimplemented("Not yet implemented"))
}

async fn do_put_prepared_statement_query(
&self,
_query: CommandPreparedStatementQuery,
_request: Streaming<FlightData>,
_request: Request<Streaming<FlightData>>,
) -> Result<Response<<Self as FlightService>::DoPutStream>, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"do_put_prepared_statement_query not implemented",
))
}

async fn do_put_prepared_statement_update(
&self,
_query: CommandPreparedStatementUpdate,
_request: Streaming<FlightData>,
_request: Request<Streaming<FlightData>>,
) -> Result<i64, Status> {
Err(Status::unimplemented("Not yet implemented"))
Err(Status::unimplemented(
"do_put_prepared_statement_update not implemented",
))
}

// do_action
async fn do_action_create_prepared_statement(
&self,
_query: ActionCreatePreparedStatementRequest,
_metadata: MetadataMap,
) -> Result<ActionCreatePreparedStatementResult, Status> {
Err(Status::unimplemented("Not yet implemented"))
}
async fn do_action_close_prepared_statement(
&self,
_query: ActionClosePreparedStatementRequest,
_metadata: MetadataMap,
) {
unimplemented!("Not yet implemented")
}
Expand Down
Loading