use of org.apache.drill.test.ClientFixture in project drill by apache.
the class TestConfigLinkage method testScopeSystem.
/* Test if the option is set at SYSTEM scope and the scope is actually SYSTEM */
@Test
public void testScopeSystem() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.bareBuilder(dirTestWatcher).systemOption(ExecConstants.SLICE_TARGET, 10000);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
String scope = client.queryBuilder().sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName()).singletonString();
Assert.assertEquals("SYSTEM", scope);
}
}
use of org.apache.drill.test.ClientFixture in project drill by apache.
the class TestConfigLinkage method testMaxWidthPerNodeSession.
/* Test if setting maxwidth at session level takes precedence */
@Test
public void testMaxWidthPerNodeSession() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.bareBuilder(dirTestWatcher).sessionOption(ExecConstants.MAX_WIDTH_PER_NODE_KEY, 2);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node' and optionScope = 'SESSION'", SystemTable.OPTIONS.getTableName()).singletonString();
assertEquals("2", maxWidth);
}
}
use of org.apache.drill.test.ClientFixture in project drill by apache.
the class TestConfigLinkage method testScopeSession.
/* Test if the option is set at SESSION scope and the scope is actually SESSION */
@Test
public void testScopeSession() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.bareBuilder(dirTestWatcher).sessionOption(ExecConstants.SLICE_TARGET, 100000);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
String scope = client.queryBuilder().sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName()).singletonString();
Assert.assertEquals("SESSION", scope);
}
}
use of org.apache.drill.test.ClientFixture in project drill by apache.
the class TestConfigLinkage method testDefaultInternalValue.
@Test
public void testDefaultInternalValue() throws Exception {
OptionDefinition optionDefinition = createMockPropOptionDefinition();
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.bootDefaultFor(MOCK_PROPERTY), "a").putDefinition(optionDefinition);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
String mockProp = client.queryBuilder().sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(), MOCK_PROPERTY).singletonString();
String mockProp2 = client.queryBuilder().sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(), MOCK_PROPERTY).singletonString();
assertEquals("a", mockProp);
assertEquals("a", mockProp2);
}
}
use of org.apache.drill.test.ClientFixture in project drill by apache.
the class TestConfigLinkage method testMaxWidthPerNodeConfig.
/* Test if setting maxwidth option through config takes effect */
@Test
public void testMaxWidthPerNodeConfig() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.bareBuilder(dirTestWatcher).setOptionDefault(ExecConstants.MAX_WIDTH_PER_NODE_KEY, 2);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node' and optionScope = 'BOOT'", SystemTable.OPTIONS.getTableName()).singletonString();
assertEquals("2", maxWidth);
}
}
Aggregations