use of org.apache.drill.exec.physical.impl.scan.framework.ManagedScanFramework.ReaderFactory in project drill by apache.
the class HttpScanBatchCreator method createBuilder.
private ScanFrameworkBuilder createBuilder(OptionManager options, HttpSubScan subScan) {
ScanFrameworkBuilder builder = new ScanFrameworkBuilder();
builder.projection(subScan.columns());
builder.setUserName(subScan.getUserName());
// Provide custom error context
builder.errorContext(new ChildErrorContext(builder.errorContext()) {
@Override
public void addContext(UserException.Builder builder) {
builder.addContext("Connection", subScan.tableSpec().connection());
builder.addContext("Plugin", subScan.tableSpec().pluginName());
}
});
// Reader
ReaderFactory readerFactory = new HttpReaderFactory(subScan);
builder.setReaderFactory(readerFactory);
builder.nullType(Types.optional(MinorType.VARCHAR));
return builder;
}
use of org.apache.drill.exec.physical.impl.scan.framework.ManagedScanFramework.ReaderFactory in project drill by apache.
the class SplunkScanBatchCreator method createBuilder.
private ScanFrameworkBuilder createBuilder(OptionManager options, SplunkSubScan subScan) {
SplunkPluginConfig config = subScan.getConfig();
ScanFrameworkBuilder builder = new ScanFrameworkBuilder();
builder.projection(subScan.getColumns());
builder.setUserName(subScan.getUserName());
// Reader
ReaderFactory readerFactory = new SplunkReaderFactory(config, subScan);
builder.setReaderFactory(readerFactory);
builder.nullType(Types.optional(MinorType.VARCHAR));
return builder;
}
use of org.apache.drill.exec.physical.impl.scan.framework.ManagedScanFramework.ReaderFactory in project drill by apache.
the class PhoenixScanBatchCreator method createBuilder.
private ScanFrameworkBuilder createBuilder(OptionManager options, PhoenixSubScan subScan) {
ScanFrameworkBuilder builder = new ScanFrameworkBuilder();
builder.projection(subScan.getColumns());
builder.setUserName(subScan.getUserName());
// Phoenix reader
ReaderFactory readerFactory = new PhoenixReaderFactory(subScan);
builder.setReaderFactory(readerFactory);
builder.nullType(Types.optional(MinorType.VARCHAR));
// Add custom error context
builder.errorContext(new ChildErrorContext(builder.errorContext()) {
@Override
public void addContext(UserException.Builder builder) {
builder.addContext("sql : ", subScan.getScanSpec().getSql());
builder.addContext("columns : ", subScan.getScanSpec().getColumns().toString());
builder.addContext("estimate row count : ", subScan.getScanSpec().getEstimateRows());
}
});
return builder;
}
Aggregations