use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestOrderedMuxExchange method testLimitOnOrderedMuxWindow.
/**
* Test case to verify the OrderedMuxExchange created for order by with limit and window agg.
* It checks that the limit is pushed down the OrderedMuxExchange.
*
* @throws Exception if anything goes wrong
*/
@Test
public void testLimitOnOrderedMuxWindow() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).maxParallelization(1).configProperty(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, true);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
client.alterSession(ExecConstants.SLICE_TARGET, 10);
String sql = "SELECT emp_name, max(emp_id) over (order by emp_name) FROM dfs.`empTable` e order BY emp_name limit 10";
client.testBuilder().unOrdered().optionSettingQueriesForTestQuery("alter session set `planner.slice_target` = 10;").sqlQuery(sql).optionSettingQueriesForBaseline(// Use default option setting.
"alter session set `planner.enable_ordered_mux_exchange` = false").sqlBaselineQuery(sql).build().run();
client.alterSession(ExecConstants.ORDERED_MUX_EXCHANGE, true);
String explainText = client.queryBuilder().sql(sql).explainText();
assertTrue(explainText.matches(String.format(MATCH_PATTERN_ACROSS_LINES + "%s" + MATCH_PATTERN_ACROSS_LINES + "%s" + MATCH_PATTERN_ACROSS_LINES, ORDERED_MUX_EXCHANGE, TOPN)));
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestOrderedMuxExchange method testLimitOnOrderedMux.
/**
* Test case to verify the OrderedMuxExchange created for order by with limit.
* It checks that the limit is pushed down the OrderedMuxExchange.
*
* @throws Exception if anything goes wrong
*/
@Test
public void testLimitOnOrderedMux() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).maxParallelization(1).configProperty(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, true);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
client.alterSession(ExecConstants.SLICE_TARGET, 10);
String sql = "SELECT emp_id, emp_name FROM dfs.`empTable` e order BY emp_name, emp_id limit 10";
client.testBuilder().unOrdered().optionSettingQueriesForTestQuery("alter session set `planner.slice_target` = 10;").sqlQuery(sql).optionSettingQueriesForBaseline(// Use default option setting.
"alter session set `planner.enable_ordered_mux_exchange` = false").sqlBaselineQuery(sql).build().run();
client.alterSession(ExecConstants.ORDERED_MUX_EXCHANGE, true);
String explainText = client.queryBuilder().sql(sql).explainText();
assertTrue(explainText.matches(String.format(MATCH_PATTERN_ACROSS_LINES + "%s" + MATCH_PATTERN_ACROSS_LINES + "%s" + MATCH_PATTERN_ACROSS_LINES, ORDERED_MUX_EXCHANGE, TOPN)));
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestMetastoreCommands method setUp.
@BeforeClass
public static void setUp() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
builder.configProperty(ExecConstants.ZK_ROOT, dirTestWatcher.getRootDir().getAbsolutePath());
startCluster(builder);
dirTestWatcher.copyResourceToRoot(Paths.get("multilevel/parquet"));
dirTestWatcher.copyResourceToRoot(Paths.get("multilevel/parquet2"));
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestSchemaCaseInsensitivity method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
startCluster(builder);
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class AvroFormatTest method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
startCluster(builder);
dataGenerator = new AvroDataGenerator(dirTestWatcher);
// Create temporary table containing map and map array
mapTableName = dataGenerator.generateMapSchema().getFileName();
}
Aggregations