use of org.apache.drill.exec.store.mapr.db.binary.MapRDBBinaryTable in project drill by apache.
the class MapRDBFormatMatcher method isReadable.
@Override
public DrillTable isReadable(DrillFileSystem fs, FileSelection selection, FileSystemPlugin fsPlugin, String storageEngineName, SchemaConfig schemaConfig) throws IOException {
if (isFileReadable(fs, selection.getFirstPath(fs))) {
MapRDBFormatPlugin mapRDBFormatPlugin = (MapRDBFormatPlugin) getFormatPlugin();
String tableName = mapRDBFormatPlugin.getTableName(selection);
TableProperties props = mapRDBFormatPlugin.getMaprFS().getTableProperties(new Path(tableName));
if (props.getAttr().getJson()) {
return new DynamicDrillTable(fsPlugin, storageEngineName, schemaConfig.getUserName(), new FormatSelection(mapRDBFormatPlugin.getConfig(), selection));
} else {
FormatSelection formatSelection = new FormatSelection(mapRDBFormatPlugin.getConfig(), selection);
return new MapRDBBinaryTable(storageEngineName, fsPlugin, mapRDBFormatPlugin, formatSelection);
}
}
return null;
}
use of org.apache.drill.exec.store.mapr.db.binary.MapRDBBinaryTable in project drill by axbaretto.
the class MapRDBFormatMatcher method isReadable.
@Override
public DrillTable isReadable(DrillFileSystem fs, FileSelection selection, FileSystemPlugin fsPlugin, String storageEngineName, SchemaConfig schemaConfig) throws IOException {
if (isFileReadable(fs, selection.getFirstPath(fs))) {
List<String> files = selection.getFiles();
assert (files.size() == 1);
String tableName = files.get(0);
TableProperties props = getFormatPlugin().getMaprFS().getTableProperties(new Path(tableName));
if (props.getAttr().getJson()) {
return new DynamicDrillTable(fsPlugin, storageEngineName, schemaConfig.getUserName(), new FormatSelection(getFormatPlugin().getConfig(), selection));
} else {
FormatSelection formatSelection = new FormatSelection(getFormatPlugin().getConfig(), selection);
return new MapRDBBinaryTable(storageEngineName, fsPlugin, (MapRDBFormatPlugin) getFormatPlugin(), formatSelection);
}
}
return null;
}
Aggregations