use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestTpchDistributedConcurrent method setUp.
@BeforeClass
public static void setUp() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.USER_RPC_TIMEOUT, 5_000);
startCluster(builder);
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestTextWriter method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
startCluster(builder);
Map<String, FormatPluginConfig> formats = new HashMap<>();
formats.put("csv", new TextFormatConfig(Collections.singletonList("csv"), // line delimiter
"\n", // field delimiter
",", // quote
"\"", // escape
"\"", // comment
null, // skip first line
false, // extract header
true));
formats.put("tsv", new TextFormatConfig(Collections.singletonList("tsv"), // line delimiter
"\n", // field delimiter
"\t", // quote
"\"", // escape
"\"", // comment
null, // skip first line
false, // extract header
true));
formats.put("custom", new TextFormatConfig(Collections.singletonList("custom"), // line delimiter
"!", // field delimiter
"_", // quote
"$", // escape
"^", // comment
null, // skip first line
false, // extract header
true));
cluster.defineFormats("dfs", formats);
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestValidationOptions method testOptions.
// To validate these tests, set breakpoints in ImplCreator
// and IteratorValidatorBatchIterator to see if the options
// work as expected.
@Test
public void testOptions() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).maxParallelization(1).configProperty(ExecConstants.ENABLE_ITERATOR_VALIDATION, false).configProperty(ExecConstants.ENABLE_VECTOR_VALIDATION, false).sessionOption(ExecConstants.ENABLE_ITERATOR_VALIDATION_OPTION, true).sessionOption(ExecConstants.ENABLE_VECTOR_VALIDATION_OPTION, true);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
boolean hasAssertions = false;
assert hasAssertions = true;
assertFalse(hasAssertions);
String sql = "SELECT id_i, name_s10 FROM `mock`.`customers_10`";
client.queryBuilder().sql(sql).run();
client.alterSession(ExecConstants.ENABLE_VECTOR_VALIDATION, false);
client.queryBuilder().sql(sql).run();
client.alterSession(ExecConstants.ENABLE_ITERATOR_VALIDATION, false);
client.queryBuilder().sql(sql).run();
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestValidationOptions method testConfig.
/**
* Config options override session options. Config options allow passing in
* the setting at run time on the command line. This is a work-around for the
* fact that the config system has no generic solution at present.
*
* @throws Exception if anything goes wrong
*/
@Test
public void testConfig() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).maxParallelization(1).configProperty(ExecConstants.ENABLE_ITERATOR_VALIDATION, true).configProperty(ExecConstants.ENABLE_VECTOR_VALIDATION, true).sessionOption(ExecConstants.ENABLE_ITERATOR_VALIDATION_OPTION, false).sessionOption(ExecConstants.ENABLE_VECTOR_VALIDATION_OPTION, false);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
boolean hasAssertions = false;
assert hasAssertions = true;
assertFalse(hasAssertions);
String sql = "SELECT id_i, name_s10 FROM `mock`.`customers_10`";
client.queryBuilder().sql(sql).run();
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by axbaretto.
the class TestValidationOptions method testOptions.
// To validate these tests, set breakpoints in ImplCreator
// and IteratorValidatorBatchIterator to see if the options
// work as expected.
@Test
public void testOptions() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).maxParallelization(1).configProperty(ExecConstants.ENABLE_ITERATOR_VALIDATION, false).configProperty(ExecConstants.ENABLE_VECTOR_VALIDATION, false).sessionOption(ExecConstants.ENABLE_ITERATOR_VALIDATION_OPTION, true).sessionOption(ExecConstants.ENABLE_VECTOR_VALIDATION_OPTION, true);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
boolean hasAssertions = false;
assert hasAssertions = true;
assertFalse(hasAssertions);
String sql = "SELECT id_i, name_s10 FROM `mock`.`customers_10`";
client.queryBuilder().sql(sql).run();
client.alterSession(ExecConstants.ENABLE_VECTOR_VALIDATION, false);
client.queryBuilder().sql(sql).run();
client.alterSession(ExecConstants.ENABLE_ITERATOR_VALIDATION, false);
client.queryBuilder().sql(sql).run();
}
}
Aggregations