use of com.mapr.fs.tables.TableProperties in project drill by axbaretto.
the class MapRDBFormatPlugin method getGroupScan.
@Override
public AbstractGroupScan getGroupScan(String userName, FileSelection selection, List<SchemaPath> columns) throws IOException {
String tableName = getTableName(selection);
TableProperties props = getMaprFS().getTableProperties(new Path(tableName));
if (props.getAttr().getJson()) {
JsonScanSpec scanSpec = new JsonScanSpec(tableName, null);
return new JsonTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns);
} else {
HBaseScanSpec scanSpec = new HBaseScanSpec(tableName);
return new BinaryTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns);
}
}
use of com.mapr.fs.tables.TableProperties 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 com.mapr.fs.tables.TableProperties in project drill by apache.
the class MapRDBFormatPlugin method getGroupScan.
@Override
public AbstractGroupScan getGroupScan(String userName, FileSelection selection, List<SchemaPath> columns) throws IOException {
List<String> files = selection.getFiles();
assert (files.size() == 1);
String tableName = files.get(0);
TableProperties props = getMaprFS().getTableProperties(new Path(tableName));
if (props.getAttr().getJson()) {
JsonScanSpec scanSpec = new JsonScanSpec(tableName, null);
return new JsonTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns);
} else {
HBaseScanSpec scanSpec = new HBaseScanSpec(tableName);
return new BinaryTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns);
}
}
use of com.mapr.fs.tables.TableProperties 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;
}
use of com.mapr.fs.tables.TableProperties in project drill by apache.
the class MapRDBFormatPlugin method getGroupScan.
public AbstractGroupScan getGroupScan(String userName, FileSelection selection, List<SchemaPath> columns, IndexDesc indexDesc, MetadataProviderManager metadataProviderManager) throws IOException {
String tableName = getTableName(selection);
TableProperties props = getMaprFS().getTableProperties(new Path(tableName));
if (props.getAttr().getJson()) {
JsonScanSpec scanSpec = new JsonScanSpec(tableName, indexDesc, null);
return new JsonTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns, metadataProviderManager);
} else {
HBaseScanSpec scanSpec = new HBaseScanSpec(tableName);
return new BinaryTableGroupScan(userName, getStoragePlugin(), this, scanSpec, columns, metadataProviderManager);
}
}
Aggregations