Search in sources :

Example 6 with ClientFixture

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);
    }
}
Also used : ClusterFixture(org.apache.drill.test.ClusterFixture) QueryDataBatch(org.apache.drill.exec.rpc.user.QueryDataBatch) FixtureBuilder(org.apache.drill.test.FixtureBuilder) ClientFixture(org.apache.drill.test.ClientFixture)

Example 7 with ClientFixture

use of org.apache.drill.test.ClientFixture in project drill by apache.

the class TestValidationOptions method testDefaults.

/**
   * Should do no validation with all-default options.
   *
   * @throws Exception
   */
@Test
public void testDefaults() throws Exception {
    FixtureBuilder builder = ClusterFixture.builder().maxParallelization(1);
    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();
    }
}
Also used : ClusterFixture(org.apache.drill.test.ClusterFixture) FixtureBuilder(org.apache.drill.test.FixtureBuilder) ClientFixture(org.apache.drill.test.ClientFixture) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Aggregations

ClientFixture (org.apache.drill.test.ClientFixture)7 ClusterFixture (org.apache.drill.test.ClusterFixture)7 FixtureBuilder (org.apache.drill.test.FixtureBuilder)5 QueryDataBatch (org.apache.drill.exec.rpc.user.QueryDataBatch)4 DrillTest (org.apache.drill.test.DrillTest)3 Test (org.junit.Test)3 SchemaPath (org.apache.drill.common.expression.SchemaPath)1 RecordBatchLoader (org.apache.drill.exec.record.RecordBatchLoader)1 BigIntVector (org.apache.drill.exec.vector.BigIntVector)1