Hi,
I'm creating a custom adapter by
    1. Implementing org.apache.calcite.schema.SchemaFactory
    2. Create schema that directly implments org.apache.calcite.schema.Schema
    3. Inside the schema, tables that extends 
org.apache.calcite.schema.impl.AbstractTable
    
Inside my schema implemenation, i'm overriding the below methods

    import org.apache.calcite.schema.Table;
    private Map<String, Table> tableMap;

    @Override
    protected Map<String, Table> getTableMap() {
        if (tableMap == null) {
            tableMap = createTableMap();
        }
        return tableMap;
    }

    @Override
    public  Table getTable(String name) {
        return new AzStorageTable(this,name);
    }
    
This adapter will be querying set of files stored in a location. And i don't 
want to pre-populate all the file paths in the getTableMap() method. Is there a 
way to add filepath to this during the query time dynamically ? 
Overriding getTable(String name) has no effect because the validation layer 
takes the list of table names form tableMap.

Few articles on the internet mention that Apache drill does something similar 
with hdfs paths. But I'm unable to understand how Apache Drill is able to 
achieve it. 

I need help in achieving this.  Thanks for the help/suggestions in advance. 

Thanks
Arun

Reply via email to