use of org.apache.drill.test.ClientFixture 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.ClientFixture 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.ClientFixture in project drill by apache.
the class TestSimpleExternalSort method sortOneKeyDescendingExternalSort.
private void sortOneKeyDescendingExternalSort(boolean testLegacy) throws Throwable {
FixtureBuilder builder = ClusterFixture.builder().configProperty(ExecConstants.EXTERNAL_SORT_SPILL_THRESHOLD, 4).configProperty(ExecConstants.EXTERNAL_SORT_SPILL_GROUP_SIZE, 4);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
chooseImpl(client, testLegacy);
List<QueryDataBatch> results = client.queryBuilder().physicalResource("/xsort/one_key_sort_descending.json").results();
assertEquals(1000000, client.countResults(results));
validateResults(client.allocator(), results);
}
}
use of org.apache.drill.test.ClientFixture 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();
}
}
use of org.apache.drill.test.ClientFixture in project drill by axbaretto.
the class TestSimpleExternalSort method sortOneKeyDescendingExternalSort.
private void sortOneKeyDescendingExternalSort(boolean testLegacy) throws Throwable {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.EXTERNAL_SORT_SPILL_THRESHOLD, 4).configProperty(ExecConstants.EXTERNAL_SORT_SPILL_GROUP_SIZE, 4).configProperty(ExecConstants.EXTERNAL_SORT_BATCH_LIMIT, 4).configProperty(ExecConstants.EXTERNAL_SORT_DISABLE_MANAGED, false);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
chooseImpl(client, testLegacy);
List<QueryDataBatch> results = client.queryBuilder().physicalResource("/xsort/one_key_sort_descending.json").results();
assertEquals(1_000_000, client.countResults(results));
validateResults(client.allocator(), results);
}
}
Aggregations