(
&self,
request: Request<FlightDescriptor>,
)
| 49 | type DoExchangeStream = BoxStream<'static, Result<FlightData, Status>>; |
| 50 | |
| 51 | async fn get_schema( |
| 52 | &self, |
| 53 | request: Request<FlightDescriptor>, |
| 54 | ) -> Result<Response<SchemaResult>, Status> { |
| 55 | let request = request.into_inner(); |
| 56 | |
| 57 | let listing_options = ListingOptions::new(Arc::new(ParquetFormat::default())); |
| 58 | let table_path = |
| 59 | ListingTableUrl::parse(&request.path[0]).map_err(to_tonic_err)?; |
| 60 | |
| 61 | let ctx = SessionContext::new(); |
| 62 | let schema = listing_options |
| 63 | .infer_schema(&ctx.state(), &table_path) |
| 64 | .await |
| 65 | .unwrap(); |
| 66 | |
| 67 | let options = arrow::ipc::writer::IpcWriteOptions::default(); |
| 68 | let schema_result = SchemaAsIpc::new(&schema, &options) |
| 69 | .try_into() |
| 70 | .map_err(|e: ArrowError| Status::internal(e.to_string()))?; |
| 71 | |
| 72 | Ok(Response::new(schema_result)) |
| 73 | } |
| 74 | |
| 75 | async fn do_get( |
| 76 | &self, |
no test coverage detected