Search in sources :

Example 1 with PluginDrillTable

use of org.apache.drill.exec.store.plan.rel.PluginDrillTable in project drill by apache.

the class IcebergFormatMatcher method isReadable.

@Override
public DrillTable isReadable(DrillFileSystem fs, FileSelection selection, FileSystemPlugin fsPlugin, String storageEngineName, SchemaConfig schemaConfig) throws IOException {
    Path selectionRoot = selection.getSelectionRoot();
    Path metaDir = new Path(selectionRoot, METADATA_DIR_NAME);
    if (fs.isDirectory(selectionRoot) && fs.exists(metaDir) && fs.isDirectory(metaDir)) {
        FormatSelection formatSelection = new FormatSelection(formatPlugin.getConfig(), selection);
        return new PluginDrillTable(fsPlugin, storageEngineName, schemaConfig.getUserName(), formatSelection, formatPlugin.getConvention());
    }
    return null;
}
Also used : Path(org.apache.hadoop.fs.Path) FormatSelection(org.apache.drill.exec.store.dfs.FormatSelection) PluginDrillTable(org.apache.drill.exec.store.plan.rel.PluginDrillTable)

Aggregations

FormatSelection (org.apache.drill.exec.store.dfs.FormatSelection)1 PluginDrillTable (org.apache.drill.exec.store.plan.rel.PluginDrillTable)1 Path (org.apache.hadoop.fs.Path)1