use of org.apache.drill.exec.proto.UserProtos.QueryPlanFragments in project drill by apache.
the class DrillSeparatePlanningTest method testMultiMinorFragmentComplexQuery.
@Test(timeout = 30000)
public void testMultiMinorFragmentComplexQuery() throws Exception {
final String query = String.format("SELECT dir0, sum(o_totalprice) FROM dfs_test.`%s/multilevel/json` group by dir0 order by dir0", TEST_RES_PATH);
QueryPlanFragments planFragments = getFragmentsHelper(query);
assertNotNull(planFragments);
assertTrue((planFragments.getFragmentsCount() > 1));
for (PlanFragment planFragment : planFragments.getFragmentsList()) {
assertTrue(planFragment.getLeafFragment());
}
getResultsHelper(planFragments);
}
use of org.apache.drill.exec.proto.UserProtos.QueryPlanFragments in project drill by apache.
the class DrillSeparatePlanningTest method getFragmentsHelper.
private QueryPlanFragments getFragmentsHelper(final String query) throws InterruptedException, ExecutionException, RpcException {
updateTestCluster(2, config);
List<QueryDataBatch> results = client.runQuery(QueryType.SQL, "alter session set `planner.slice_target`=1");
for (QueryDataBatch batch : results) {
batch.release();
}
DrillRpcFuture<QueryPlanFragments> queryFragmentsFutures = client.planQuery(QueryType.SQL, query, true);
final QueryPlanFragments planFragments = queryFragmentsFutures.get();
for (PlanFragment fragment : planFragments.getFragmentsList()) {
System.out.println(fragment.getFragmentJson());
}
return planFragments;
}
use of org.apache.drill.exec.proto.UserProtos.QueryPlanFragments in project drill by apache.
the class DrillSeparatePlanningTest method testPlanningNegative.
@Test(timeout = 30000)
public void testPlanningNegative() throws Exception {
final String query = String.format("SELECT dir0, sum(o_totalprice) FROM dfs_test.`%s/multilevel/json` group by dir0 order by dir0", TEST_RES_PATH);
updateTestCluster(2, config);
// LOGICAL is not supported
DrillRpcFuture<QueryPlanFragments> queryFragmentsFutures = client.planQuery(QueryType.LOGICAL, query, false);
final QueryPlanFragments planFragments = queryFragmentsFutures.get();
assertNotNull(planFragments);
assertNotNull(planFragments.getError());
assertTrue(planFragments.getFragmentsCount() == 0);
}
Aggregations