/// Returns a schema object for a `read_filter` operation using the provided
/// column selection. An error is returned if the specified columns do not
/// exist.
Returns a schema object for a `read_filter` operation using the provided
column selection. An error is returned if the specified columns do not
exist.
Returns a schema object for a ` read_filter ` operation using the provided column selection . An error is returned if the specified columns do not exist .
pub fn read_filter_table_schema(
        &self,
        table_name: &str,
        columns: Selection<'_>,
    ) -> Result<Schema> {
        // read lock on chunk.
        let chunk_data = self.chunk_data.read();
        let table = chunk_data
            .data
            .get(table_name)
            .context(TableNotFound { table_name })?;
        // Validate columns exist in table.
        let table_meta = table.meta();
        if let Selection::Some(cols) = columns {
            for column_name in cols {
                if !table_meta.has_column(column_name) {
                    return ColumnDoesNotExist {
                        column_name: column_name.to_string(),
                        table_name: table_name.to_string(),
                    }
                    .fail();
                }
            }
        }
        // Build a table schema
        Schema::try_from(&ResultSchema {
            select_columns: match columns {
                Selection::All => table_meta.schema_for_all_columns(),
                Selection::Some(column_names) => table_meta.schema_for_column_names(column_names),
            },
            ..ResultSchema::default()
        })
        .context(TableSchemaError)
    }
pub fn read_filter_table_schema ( & self , table_name : & str , columns : Selection < ' _ > , ) -> Result < Schema > { // read lock on chunk. let chunk_data = self . chunk_data . read ( ) ; let table = chunk_data . data . get ( table_name ) . context ( TableNotFound { table_name } ) ? ; // Validate columns exist in table. let table_meta = table . meta ( ) ; if let Selection :: Some ( cols ) = columns { for column_name in cols { if ! table_meta . has_column ( column_name ) { return ColumnDoesNotExist { column_name : column_name . to_string ( ) , table_name : table_name . to_string ( ) , } . fail ( ) ; } } } // Build a table schema Schema :: try_from ( & ResultSchema { select_columns : match columns { Selection :: All => table_meta . schema_for_all_columns ( ) , Selection :: Some ( column_names ) => table_meta . schema_for_column_names ( column_names ) , } , .. ResultSchema :: default ( ) } ) . context ( TableSchemaError ) }
Returns a schema object for a `read_filter` operation using the provided
column selection.
Returns a schema object for a ` read_filter ` operation using the provided column selection .
&self
table_name
&str
columns
Selection<'_>