/// Create new namespace for given schema.
Create new namespace for given schema.
Create new namespace for given schema .
pub fn new(
        chunk_adapter: Arc<ChunkAdapter>,
        schema: Arc<NamespaceSchema>,
        name: Arc<str>,
        exec: Arc<Executor>,
        ingester_connection: Arc<dyn IngesterConnection>,
        query_log: Arc<QueryLog>,
    ) -> Self {
        let tables: HashMap<_, _> = schema
            .tables
            .iter()
            .map(|(table_name, table_schema)| {
                let table_name = Arc::from(table_name.clone());
                let id = table_schema.id;
                let schema = Schema::try_from(table_schema.clone()).expect("cannot build schema");
                let table = Arc::new(QuerierTable::new(
                    Arc::clone(&name),
                    id,
                    Arc::clone(&table_name),
                    Arc::new(schema),
                    Arc::clone(&ingester_connection),
                    Arc::clone(&chunk_adapter),
                ));
                (table_name, table)
            })
            .collect();
        let id = schema.id;
        Self {
            id,
            name,
            tables: Arc::new(tables),
            exec,
            catalog_cache: Arc::clone(chunk_adapter.catalog_cache()),
            query_log,
        }
    }
pub fn new ( chunk_adapter : Arc < ChunkAdapter > , schema : Arc < NamespaceSchema > , name : Arc < str > , exec : Arc < Executor > , ingester_connection : Arc < dyn IngesterConnection > , query_log : Arc < QueryLog > , ) -> Self { let tables : HashMap < _ , _ > = schema . tables . iter ( ) . map ( | ( table_name , table_schema ) | { let table_name = Arc :: from ( table_name . clone ( ) ) ; let id = table_schema . id ; let schema = Schema :: try_from ( table_schema . clone ( ) ) . expect ( " " ) ; let table = Arc :: new ( QuerierTable :: new ( Arc :: clone ( & name ) , id , Arc :: clone ( & table_name ) , Arc :: new ( schema ) , Arc :: clone ( & ingester_connection ) , Arc :: clone ( & chunk_adapter ) , ) ) ; ( table_name , table ) } ) . collect ( ) ; let id = schema . id ; Self { id , name , tables : Arc :: new ( tables ) , exec , catalog_cache : Arc :: clone ( chunk_adapter . catalog_cache ( ) ) , query_log , } }
Create new namespace for given schema.
Create new namespace for given schema .
chunk_adapter
Arc<ChunkAdapter>
schema
Arc<NamespaceSchema>
name
Arc<str>
exec
Arc<Executor>
ingester_connection
Arc<dyn IngesterConnection>
query_log
Arc<QueryLog>