Search in sources :

Example 71 with ClusterFixtureBuilder

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);
}
Also used : ClusterFixtureBuilder(org.apache.drill.test.ClusterFixtureBuilder) BeforeClass(org.junit.BeforeClass)

Example 72 with ClusterFixtureBuilder

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);
}
Also used : HashMap(java.util.HashMap) FormatPluginConfig(org.apache.drill.common.logical.FormatPluginConfig) TextFormatConfig(org.apache.drill.exec.store.easy.text.TextFormatPlugin.TextFormatConfig) ClusterFixtureBuilder(org.apache.drill.test.ClusterFixtureBuilder) BeforeClass(org.junit.BeforeClass)

Example 73 with ClusterFixtureBuilder

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();
    }
}
Also used : ClusterFixture(org.apache.drill.test.ClusterFixture) ClientFixture(org.apache.drill.test.ClientFixture) ClusterFixtureBuilder(org.apache.drill.test.ClusterFixtureBuilder) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Example 74 with ClusterFixtureBuilder

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();
    }
}
Also used : ClusterFixture(org.apache.drill.test.ClusterFixture) ClientFixture(org.apache.drill.test.ClientFixture) ClusterFixtureBuilder(org.apache.drill.test.ClusterFixtureBuilder) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Example 75 with ClusterFixtureBuilder

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();
    }
}
Also used : ClusterFixture(org.apache.drill.test.ClusterFixture) ClientFixture(org.apache.drill.test.ClientFixture) ClusterFixtureBuilder(org.apache.drill.test.ClusterFixtureBuilder) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Aggregations

ClusterFixtureBuilder (org.apache.drill.test.ClusterFixtureBuilder)156 ClusterFixture (org.apache.drill.test.ClusterFixture)102 Test (org.junit.Test)93 ClientFixture (org.apache.drill.test.ClientFixture)89 BeforeClass (org.junit.BeforeClass)47 SlowTest (org.apache.drill.categories.SlowTest)44 OptionsTest (org.apache.drill.categories.OptionsTest)34 BaseTest (org.apache.drill.test.BaseTest)27 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)15 DrillTest (org.apache.drill.test.DrillTest)14 OperatorTest (org.apache.drill.categories.OperatorTest)8 QueryDataBatch (org.apache.drill.exec.rpc.user.QueryDataBatch)8 FileSystemConfig (org.apache.drill.exec.store.dfs.FileSystemConfig)6 StoragePluginConfig (org.apache.drill.common.logical.StoragePluginConfig)5 PluginException (org.apache.drill.exec.store.StoragePluginRegistry.PluginException)5 File (java.io.File)4 ResourceManagerTest (org.apache.drill.categories.ResourceManagerTest)4 DefaultResourceManager (org.apache.drill.exec.work.foreman.rm.DefaultResourceManager)4 DistributedResourceManager (org.apache.drill.exec.work.foreman.rm.DistributedResourceManager)4 ResourceManager (org.apache.drill.exec.work.foreman.rm.ResourceManager)4