use of org.apache.drill.exec.planner.fragment.QueueQueryParallelizer in project drill by apache.
the class TestMemoryCalculator method TestSingleMajorFragmentWithProjectAndScan.
@Test
public void TestSingleMajorFragmentWithProjectAndScan() throws Exception {
List<DrillbitEndpoint> activeEndpoints = getEndpoints(2, new HashSet<>());
Map<DrillbitEndpoint, NodeResource> resources = activeEndpoints.stream().collect(Collectors.toMap(x -> x, x -> NodeResource.create()));
String sql = "SELECT * from cp.`tpch/nation.parquet`";
SimpleParallelizer parallelizer = new QueueQueryParallelizer(false, queryContext);
PlanningSet planningSet = preparePlanningSet(activeEndpoints, DEFAULT_SLICE_TARGET, resources, sql, parallelizer);
parallelizer.adjustMemory(planningSet, createSet(planningSet.getRootWrapper()), activeEndpoints);
assertTrue("memory requirement is different", Iterables.all(resources.entrySet(), (e) -> e.getValue().getMemory() == 30));
}
use of org.apache.drill.exec.planner.fragment.QueueQueryParallelizer in project drill by apache.
the class TestMemoryCalculator method TestTwoMajorFragmentWithSortyProjectAndScan.
@Test
public void TestTwoMajorFragmentWithSortyProjectAndScan() throws Exception {
List<DrillbitEndpoint> activeEndpoints = getEndpoints(2, new HashSet<>());
Map<DrillbitEndpoint, NodeResource> resources = activeEndpoints.stream().collect(Collectors.toMap(x -> x, x -> NodeResource.create()));
String sql = "SELECT * from cp.`tpch/lineitem.parquet` order by dept_id";
SimpleParallelizer parallelizer = new QueueQueryParallelizer(false, queryContext);
PlanningSet planningSet = preparePlanningSet(activeEndpoints, 2, resources, sql, parallelizer);
parallelizer.adjustMemory(planningSet, createSet(planningSet.getRootWrapper()), activeEndpoints);
assertTrue("memory requirement is different", Iterables.all(resources.entrySet(), (e) -> e.getValue().getMemory() == 481490));
}
use of org.apache.drill.exec.planner.fragment.QueueQueryParallelizer in project drill by apache.
the class TestMemoryCalculator method TestSingleMajorFragmentWithGroupByProjectAndScan.
@Test
public void TestSingleMajorFragmentWithGroupByProjectAndScan() throws Exception {
List<DrillbitEndpoint> activeEndpoints = getEndpoints(2, new HashSet<>());
Map<DrillbitEndpoint, NodeResource> resources = activeEndpoints.stream().collect(Collectors.toMap(x -> x, x -> NodeResource.create()));
String sql = "SELECT dept_id, count(*) from cp.`tpch/lineitem.parquet` group by dept_id";
SimpleParallelizer parallelizer = new QueueQueryParallelizer(false, queryContext);
PlanningSet planningSet = preparePlanningSet(activeEndpoints, DEFAULT_SLICE_TARGET, resources, sql, parallelizer);
parallelizer.adjustMemory(planningSet, createSet(planningSet.getRootWrapper()), activeEndpoints);
assertTrue("memory requirement is different", Iterables.all(resources.entrySet(), (e) -> e.getValue().getMemory() == 529570));
}
Aggregations