MCPcopy Create free account
hub / github.com/apache/datafusion / get_flight_info_tables

Method get_flight_info_tables

datafusion-examples/examples/flight/sql_server.rs:336–365  ·  view source on GitHub ↗
(
        &self,
        _query: CommandGetTables,
        request: Request<FlightDescriptor>,
    )

Source from the content-addressed store, hash-verified

334 }
335
336 async fn get_flight_info_tables(
337 &self,
338 _query: CommandGetTables,
339 request: Request<FlightDescriptor>,
340 ) -> Result<Response<FlightInfo>, Status> {
341 info!("get_flight_info_tables");
342 let ctx = self.get_ctx(&request)?;
343 let data = self.tables(ctx).await;
344 let schema = data.schema();
345
346 let uuid = Uuid::new_v4().hyphenated().to_string();
347 self.results.insert(uuid.clone(), vec![data]);
348
349 let fetch = FetchResults { handle: uuid };
350 let buf = fetch.as_any().encode_to_vec().into();
351 let ticket = Ticket { ticket: buf };
352
353 let info = FlightInfo::new()
354 // Encode the Arrow schema
355 .try_with_schema(&schema)
356 .expect("encoding failed")
357 .with_endpoint(FlightEndpoint::new().with_ticket(ticket))
358 .with_descriptor(FlightDescriptor {
359 r#type: DescriptorType::Cmd.into(),
360 cmd: Default::default(),
361 path: vec![],
362 });
363 let resp = Response::new(info);
364 Ok(resp)
365 }
366
367 async fn do_put_prepared_statement_update(
368 &self,

Callers

nothing calls this directly

Calls 9

newFunction · 0.85
get_ctxMethod · 0.80
tablesMethod · 0.80
schemaMethod · 0.45
to_stringMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45
intoMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected