MCPcopy Create free account
hub / github.com/apache/arrow-rs / do_get_tables

Method do_get_tables

arrow-flight/tests/flight_sql_client_cli.rs:648–689  ·  view source on GitHub ↗
(
        &self,
        query: CommandGetTables,
        _request: Request<Ticket>,
    )

Source from the content-addressed store, hash-verified

646 }
647
648 async fn do_get_tables(
649 &self,
650 query: CommandGetTables,
651 _request: Request<Ticket>,
652 ) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
653 let mut builder = query.into_builder();
654 for (catalog_name, schema_name, table_name, table_type, schema) in [
655 (
656 "catalog_a",
657 "schema_1",
658 "table_1",
659 "TABLE",
660 Arc::new(Schema::empty()),
661 ),
662 (
663 "catalog_a",
664 "schema_2",
665 "table_2",
666 "VIEW",
667 Arc::new(Schema::empty()),
668 ),
669 (
670 "catalog_b",
671 "schema_3",
672 "table_3",
673 "TABLE",
674 Arc::new(Schema::empty()),
675 ),
676 ] {
677 builder
678 .append(catalog_name, schema_name, table_name, table_type, &schema)
679 .unwrap();
680 }
681
682 let schema = builder.schema();
683 let batch = builder.build();
684 let stream = FlightDataEncoderBuilder::new()
685 .with_schema(schema)
686 .build(futures::stream::once(async { batch }))
687 .map_err(Status::from);
688 Ok(Response::new(Box::pin(stream)))
689 }
690
691 async fn do_get_table_types(
692 &self,

Callers

nothing calls this directly

Calls 5

into_builderMethod · 0.45
appendMethod · 0.45
schemaMethod · 0.45
buildMethod · 0.45
with_schemaMethod · 0.45

Tested by

no test coverage detected