@Test public void canExecuteFromPhysicalPlan() { doAnswer(invocation -> { ResponseListener<QueryResponse> listener = invocation.getArgument(1); listener.onResponse(new QueryResponse(schema, Collections.emptyList())); return null; }).when(executionEngine).execute(any(), any()); sqlService.execute(mock(PhysicalPlan.class), new ResponseListener<QueryResponse>() { @Override public void onResponse(QueryResponse response) { assertNotNull(response); } @Override public void onFailure(Exception e) { fail(e); } }); }
public void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener) { try { executionEngine.execute( plan( analyze( parse(request.getQuery()))), listener); } catch (Exception e) { listener.onFailure(e); } }
SQLService { public void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener) { try { executionEngine.execute( plan( analyze( parse(request.getQuery()))), listener); } catch (Exception e) { listener.onFailure(e); } } }
SQLService { public void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener) { try { executionEngine.execute( plan( analyze( parse(request.getQuery()))), listener); } catch (Exception e) { listener.onFailure(e); } } SQLService(SQLSyntaxParser parser, Analyzer analyzer,
                    StorageEngine storageEngine, ExecutionEngine executionEngine); }
SQLService { public void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener) { try { executionEngine.execute( plan( analyze( parse(request.getQuery()))), listener); } catch (Exception e) { listener.onFailure(e); } } SQLService(SQLSyntaxParser parser, Analyzer analyzer,
                    StorageEngine storageEngine, ExecutionEngine executionEngine); void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener); void execute(PhysicalPlan plan, ResponseListener<QueryResponse> listener); UnresolvedPlan parse(String query); LogicalPlan analyze(UnresolvedPlan ast); PhysicalPlan plan(LogicalPlan logicalPlan); }
SQLService { public void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener) { try { executionEngine.execute( plan( analyze( parse(request.getQuery()))), listener); } catch (Exception e) { listener.onFailure(e); } } SQLService(SQLSyntaxParser parser, Analyzer analyzer,
                    StorageEngine storageEngine, ExecutionEngine executionEngine); void execute(SQLQueryRequest request, ResponseListener<QueryResponse> listener); void execute(PhysicalPlan plan, ResponseListener<QueryResponse> listener); UnresolvedPlan parse(String query); LogicalPlan analyze(UnresolvedPlan ast); PhysicalPlan plan(LogicalPlan logicalPlan);  }