[ 
https://issues.apache.org/jira/browse/DRILL-4132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262816#comment-15262816
 ] 

ASF GitHub Bot commented on DRILL-4132:
---------------------------------------

Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/368#discussion_r61490732
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java ---
    @@ -321,6 +329,38 @@ public void close() {
         return listener.getResults();
       }
     
    +  public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, 
String query, boolean isSplitPlan) {
    +    GetQueryPlanFragments runQuery = 
GetQueryPlanFragments.newBuilder().setQuery(query).setType(type).setSplitPlan(isSplitPlan).build();
    +    return client.submitPlanQuery(runQuery);
    +  }
    +
    +  public void runQuery(QueryType type, List<PlanFragment> planFragments, 
UserResultsListener resultsListener)
    +      throws RpcException {
    +    // QueryType can be only executional
    +    checkArgument((QueryType.EXECUTION == type), "Only EXECUTIONAL type 
query is supported with PlanFragments");
    +    // setting Plan on RunQuery will be used for logging purposes and 
therefore can not be null
    +    // since there is no Plan string provided we will create a JsonArray 
out of individual fragment Plans
    +    ArrayNode jsonArray = objectMapper.createArrayNode();
    +    for (PlanFragment fragment : planFragments) {
    +      try {
    +        jsonArray.add(objectMapper.readTree(fragment.getFragmentJson()));
    +      } catch (IOException e) {
    +        logger.error("Exception while trying to read PlanFragment JSON for 
%s", fragment.getHandle().getQueryId(), e);
    +        throw new RpcException(e);
    +      }
    +    }
    +    final String fragmentsToJsonString;
    +    try {
    +      fragmentsToJsonString = objectMapper.writeValueAsString(jsonArray);
    --- End diff --
    
    That's because we are not telling Jackson how to handle cyclicity. Can you 
try using DrillbitContext#getPlanReader instead?


> Ability to submit simple type of physical plan directly to EndPoint DrillBit 
> for execution
> ------------------------------------------------------------------------------------------
>
>                 Key: DRILL-4132
>                 URL: https://issues.apache.org/jira/browse/DRILL-4132
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Execution - Flow, Execution - RPC, Query Planning & 
> Optimization
>            Reporter: Yuliya Feldman
>            Assignee: Yuliya Feldman
>
> Today Drill Query execution is optimistic and stateful (at least due to data 
> exchanges) - if any of the stages of query execution fails whole query fails. 
> If query is just simple scan, filter push down and project where no data 
> exchange happens between DrillBits there is no need to fail whole query when 
> one DrillBit fails, as minor fragments running on that DrillBit can be rerun 
> on the other DrillBit. There are probably multiple ways to achieve this. This 
> JIRA is to open discussion on: 
> 1. agreement that we need to support above use case 
> 2. means of achieving it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to