Search in sources :

Example 1 with SchemaTreeProvider

use of org.apache.drill.exec.store.SchemaTreeProvider in project drill by apache.

the class BaseQueryRunner method applyDefaultSchema.

protected void applyDefaultSchema(String defaultSchema) throws ValidationException {
    if (!Strings.isNullOrEmpty(defaultSchema)) {
        SessionOptionManager options = webUserConnection.getSession().getOptions();
        @SuppressWarnings("resource") SchemaTreeProvider schemaTreeProvider = new SchemaTreeProvider(workManager.getContext());
        SchemaPlus rootSchema = schemaTreeProvider.createRootSchema(options);
        webUserConnection.getSession().setDefaultSchemaPath(defaultSchema, rootSchema);
    }
}
Also used : SessionOptionManager(org.apache.drill.exec.server.options.SessionOptionManager) SchemaPlus(org.apache.calcite.schema.SchemaPlus) SchemaTreeProvider(org.apache.drill.exec.store.SchemaTreeProvider)

Aggregations

SchemaPlus (org.apache.calcite.schema.SchemaPlus)1 SessionOptionManager (org.apache.drill.exec.server.options.SessionOptionManager)1 SchemaTreeProvider (org.apache.drill.exec.store.SchemaTreeProvider)1