use of com.mapr.db.exceptions.DBException in project drill by axbaretto.
the class MaprDBJsonRecordReader method setup.
@Override
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException {
this.vectorWriter = new VectorContainerWriter(output, unionEnabled);
this.operatorContext = context;
try {
table = MapRDB.getTable(tableName);
table.setOption(TableOption.EXCLUDEID, !includeId);
documentStream = table.find(condition, projectedFields);
documentReaderIterators = documentStream.documentReaders().iterator();
} catch (DBException e) {
throw new ExecutionSetupException(e);
}
}
use of com.mapr.db.exceptions.DBException in project drill by apache.
the class MapRDBIndexDiscover method getTableIndexFromMFS.
/**
* For a given table name get the list of indexes defined on the table according to the visibility of
* the indexes based on permissions.
* @param tableName table name
* @return an IndexCollection representing the list of indexes for that table
*/
private IndexCollection getTableIndexFromMFS(String tableName) {
try {
Set<DrillIndexDescriptor> idxSet = new HashSet<>();
Collection<IndexDesc> indexes = admin().getTableIndexes(new Path(tableName));
if (indexes.size() == 0) {
logger.error("No index returned from Admin.getTableIndexes for table {}", tableName);
return null;
}
for (IndexDesc idx : indexes) {
DrillIndexDescriptor hbaseIdx = buildIndexDescriptor(tableName, idx);
if (hbaseIdx == null) {
// not able to build a valid index based on the index info from MFS
logger.error("Not able to build index for {}", idx.toString());
continue;
}
idxSet.add(hbaseIdx);
}
if (idxSet.size() == 0) {
logger.error("No index found for table {}.", tableName);
return null;
}
return new DrillIndexCollection(getOriginalScanRel(), idxSet);
} catch (DBException ex) {
logger.error("Could not get table index from File system.", ex);
} catch (InvalidIndexDefinitionException ex) {
logger.error("Invalid index definition detected.", ex);
}
return null;
}
use of com.mapr.db.exceptions.DBException in project drill by apache.
the class MaprDBJsonRecordReader method setup.
@Override
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException {
this.vectorWriter = new VectorContainerWriter(output, unionEnabled);
this.vectorWriterMutator = output;
this.operatorContext = context;
try {
table.setOption(TableOption.EXCLUDEID, !includeId);
documentStream = table.find(condition, scannedFields);
documentIterator = documentStream.iterator();
setupWriter();
} catch (DBException ex) {
throw new ExecutionSetupException(ex);
}
}
Aggregations