use of org.apache.drill.common.config.DrillConfig in project drill by apache.
the class CheckStorageConfig method ensureStorageEnginePickup.
@Test
public void ensureStorageEnginePickup() {
DrillConfig config = DrillConfig.create();
ScanResult scan = ClassPathScanner.fromPrescan(config);
Collection<?> engines = scan.getImplementations(StoragePluginConfig.class);
assertEquals(engines.size(), 1);
}
use of org.apache.drill.common.config.DrillConfig in project drill by apache.
the class CheckStorageConfig method checkPlanParsing.
@Test
public void checkPlanParsing() throws Exception {
DrillConfig config = DrillConfig.create();
ScanResult scan = ClassPathScanner.fromPrescan(config);
LogicalPlan plan = LogicalPlan.parse(new LogicalPlanPersistence(config, scan), FileUtils.getResourceAsString("/storage_engine_plan.json"));
}
use of org.apache.drill.common.config.DrillConfig in project drill by apache.
the class TestFormatPluginOptionExtractor method test.
@Test
public void test() {
DrillConfig config = DrillConfig.create();
ScanResult scanResult = RunTimeScan.fromPrescan(config);
FormatPluginOptionExtractor e = new FormatPluginOptionExtractor(scanResult);
Collection<FormatPluginOptionsDescriptor> options = e.getOptions();
for (FormatPluginOptionsDescriptor d : options) {
assertEquals(d.pluginConfigClass.getAnnotation(JsonTypeName.class).value(), d.typeName);
switch(d.typeName) {
case "text":
assertEquals(TextFormatConfig.class, d.pluginConfigClass);
assertEquals("(type: String, lineDelimiter: String, fieldDelimiter: String, quote: String, escape: String, comment: String, skipFirstLine: boolean, extractHeader: boolean)", d.presentParams());
break;
case "named":
assertEquals(NamedFormatPluginConfig.class, d.pluginConfigClass);
assertEquals("(type: String, name: String)", d.presentParams());
break;
case "parquet":
assertEquals(d.typeName, "(type: String, autoCorrectCorruptDates: boolean)", d.presentParams());
break;
case "json":
case "sequencefile":
case "avro":
assertEquals(d.typeName, "(type: String)", d.presentParams());
break;
case "httpd":
assertEquals("(type: String, logFormat: String, timestampFormat: String)", d.presentParams());
break;
default:
fail("add validation for format plugin type " + d.typeName);
}
}
}
use of org.apache.drill.common.config.DrillConfig in project drill by apache.
the class TestByteComparisonFunctions method setup.
@BeforeClass
public static void setup() {
DrillConfig c = DrillConfig.create();
allocator = RootAllocatorFactory.newRoot(c);
hello = ValueHolderHelper.getVarCharHolder(allocator, "hello");
goodbye = ValueHolderHelper.getVarCharHolder(allocator, "goodbye");
helloLong = ValueHolderHelper.getVarCharHolder(allocator, "hellomyfriend");
goodbyeLong = ValueHolderHelper.getVarCharHolder(allocator, "goodbyemyenemy");
}
use of org.apache.drill.common.config.DrillConfig in project drill by apache.
the class TestPStoreProviders method verifyZkStore.
@Test
public void verifyZkStore() throws Exception {
DrillConfig config = getConfig();
String connect = config.getString(ExecConstants.ZK_CONNECTION);
CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder().namespace(config.getString(ExecConstants.ZK_ROOT)).retryPolicy(new RetryNTimes(1, 100)).connectionTimeoutMs(config.getInt(ExecConstants.ZK_TIMEOUT)).connectString(connect);
try (CuratorFramework curator = builder.build()) {
curator.start();
ZookeeperPersistentStoreProvider provider = new ZookeeperPersistentStoreProvider(config, curator);
PStoreTestUtil.test(provider);
}
}
Aggregations