You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ve...@apache.org on 2016/08/08 20:49:50 UTC

[2/4] drill git commit: DRILL-4729: Add support for prepared statement implementation on server side

http://git-wip-us.apache.org/repos/asf/drill/blob/14f6ec7d/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java b/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java
index 1bd4641..54fe315 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java
@@ -115,17 +115,25 @@ public final class UserProtos {
      */
     GET_COLUMNS(11, 17),
     /**
+     * <code>CREATE_PREPARED_STATEMENT = 22;</code>
+     *
+     * <pre>
+     * user is sending a request to create prepared statement
+     * </pre>
+     */
+    CREATE_PREPARED_STATEMENT(12, 22),
+    /**
      * <code>QUERY_DATA = 6;</code>
      *
      * <pre>
      * bit to user
      * </pre>
      */
-    QUERY_DATA(12, 6),
+    QUERY_DATA(13, 6),
     /**
      * <code>QUERY_HANDLE = 7;</code>
      */
-    QUERY_HANDLE(13, 7),
+    QUERY_HANDLE(14, 7),
     /**
      * <code>QUERY_PLAN_FRAGMENTS = 13;</code>
      *
@@ -133,7 +141,7 @@ public final class UserProtos {
      * return plan fragments
      * </pre>
      */
-    QUERY_PLAN_FRAGMENTS(14, 13),
+    QUERY_PLAN_FRAGMENTS(15, 13),
     /**
      * <code>CATALOGS = 18;</code>
      *
@@ -141,7 +149,7 @@ public final class UserProtos {
      * return catalogs metadata in response to GET_CATALOGS
      * </pre>
      */
-    CATALOGS(15, 18),
+    CATALOGS(16, 18),
     /**
      * <code>SCHEMAS = 19;</code>
      *
@@ -149,7 +157,7 @@ public final class UserProtos {
      * return schema metadata in response to GET_SCHEMAS
      * </pre>
      */
-    SCHEMAS(16, 19),
+    SCHEMAS(17, 19),
     /**
      * <code>TABLES = 20;</code>
      *
@@ -157,7 +165,7 @@ public final class UserProtos {
      * return table metadata in response to GET_TABLES
      * </pre>
      */
-    TABLES(17, 20),
+    TABLES(18, 20),
     /**
      * <code>COLUMNS = 21;</code>
      *
@@ -165,15 +173,23 @@ public final class UserProtos {
      * return column metadata in response to GET_COLUMNS
      * </pre>
      */
-    COLUMNS(18, 21),
+    COLUMNS(19, 21),
+    /**
+     * <code>PREPARED_STATEMENT = 23;</code>
+     *
+     * <pre>
+     * return preparated statement in response to CREATE_PREPARED_STATEMENT
+     * </pre>
+     */
+    PREPARED_STATEMENT(20, 23),
     /**
      * <code>REQ_META_FUNCTIONS = 8;</code>
      */
-    REQ_META_FUNCTIONS(19, 8),
+    REQ_META_FUNCTIONS(21, 8),
     /**
      * <code>RESP_FUNCTION_LIST = 9;</code>
      */
-    RESP_FUNCTION_LIST(20, 9),
+    RESP_FUNCTION_LIST(22, 9),
     /**
      * <code>QUERY_RESULT = 10;</code>
      *
@@ -181,7 +197,7 @@ public final class UserProtos {
      * drillbit is reporting a query status change, most likely a terminal message, to the user
      * </pre>
      */
-    QUERY_RESULT(21, 10),
+    QUERY_RESULT(23, 10),
     ;
 
     /**
@@ -265,6 +281,14 @@ public final class UserProtos {
      */
     public static final int GET_COLUMNS_VALUE = 17;
     /**
+     * <code>CREATE_PREPARED_STATEMENT = 22;</code>
+     *
+     * <pre>
+     * user is sending a request to create prepared statement
+     * </pre>
+     */
+    public static final int CREATE_PREPARED_STATEMENT_VALUE = 22;
+    /**
      * <code>QUERY_DATA = 6;</code>
      *
      * <pre>
@@ -317,6 +341,14 @@ public final class UserProtos {
      */
     public static final int COLUMNS_VALUE = 21;
     /**
+     * <code>PREPARED_STATEMENT = 23;</code>
+     *
+     * <pre>
+     * return preparated statement in response to CREATE_PREPARED_STATEMENT
+     * </pre>
+     */
+    public static final int PREPARED_STATEMENT_VALUE = 23;
+    /**
      * <code>REQ_META_FUNCTIONS = 8;</code>
      */
     public static final int REQ_META_FUNCTIONS_VALUE = 8;
@@ -350,6 +382,7 @@ public final class UserProtos {
         case 15: return GET_SCHEMAS;
         case 16: return GET_TABLES;
         case 17: return GET_COLUMNS;
+        case 22: return CREATE_PREPARED_STATEMENT;
         case 6: return QUERY_DATA;
         case 7: return QUERY_HANDLE;
         case 13: return QUERY_PLAN_FRAGMENTS;
@@ -357,6 +390,7 @@ public final class UserProtos {
         case 19: return SCHEMAS;
         case 20: return TABLES;
         case 21: return COLUMNS;
+        case 23: return PREPARED_STATEMENT;
         case 8: return REQ_META_FUNCTIONS;
         case 9: return RESP_FUNCTION_LIST;
         case 10: return QUERY_RESULT;
@@ -635,9 +669,9 @@ public final class UserProtos {
   public enum RequestStatus
       implements com.google.protobuf.ProtocolMessageEnum {
     /**
-     * <code>UNKNOWN = 0;</code>
+     * <code>UNKNOWN_STATUS = 0;</code>
      */
-    UNKNOWN(0, 0),
+    UNKNOWN_STATUS(0, 0),
     /**
      * <code>OK = 1;</code>
      */
@@ -646,12 +680,21 @@ public final class UserProtos {
      * <code>FAILED = 2;</code>
      */
     FAILED(2, 2),
+    /**
+     * <code>TIMEOUT = 3;</code>
+     *
+     * <pre>
+     **
+     * Request timed out. Futher attempts can change any API specific parameters and retry or just retry the request.
+     * </pre>
+     */
+    TIMEOUT(3, 3),
     ;
 
     /**
-     * <code>UNKNOWN = 0;</code>
+     * <code>UNKNOWN_STATUS = 0;</code>
      */
-    public static final int UNKNOWN_VALUE = 0;
+    public static final int UNKNOWN_STATUS_VALUE = 0;
     /**
      * <code>OK = 1;</code>
      */
@@ -660,15 +703,25 @@ public final class UserProtos {
      * <code>FAILED = 2;</code>
      */
     public static final int FAILED_VALUE = 2;
+    /**
+     * <code>TIMEOUT = 3;</code>
+     *
+     * <pre>
+     **
+     * Request timed out. Futher attempts can change any API specific parameters and retry or just retry the request.
+     * </pre>
+     */
+    public static final int TIMEOUT_VALUE = 3;
 
 
     public final int getNumber() { return value; }
 
     public static RequestStatus valueOf(int value) {
       switch (value) {
-        case 0: return UNKNOWN;
+        case 0: return UNKNOWN_STATUS;
         case 1: return OK;
         case 2: return FAILED;
+        case 3: return TIMEOUT;
         default: return null;
       }
     }
@@ -720,6 +773,248 @@ public final class UserProtos {
     // @@protoc_insertion_point(enum_scope:exec.user.RequestStatus)
   }
 
+  /**
+   * Protobuf enum {@code exec.user.ColumnSearchability}
+   *
+   * <pre>
+   *
+   * How a column can be used in WHERE clause
+   * </pre>
+   */
+  public enum ColumnSearchability
+      implements com.google.protobuf.ProtocolMessageEnum {
+    /**
+     * <code>UNKNOWN_SEARCHABILITY = 0;</code>
+     */
+    UNKNOWN_SEARCHABILITY(0, 0),
+    /**
+     * <code>NONE = 1;</code>
+     *
+     * <pre>
+     * can't be used in WHERE clause
+     * </pre>
+     */
+    NONE(1, 1),
+    /**
+     * <code>CHAR = 2;</code>
+     *
+     * <pre>
+     * can be used in WHERE clause but only with LIKE predicate
+     * </pre>
+     */
+    CHAR(2, 2),
+    /**
+     * <code>NUMBER = 3;</code>
+     *
+     * <pre>
+     * can be used in a WHERE clause with all the comparison operators except LIKE
+     * </pre>
+     */
+    NUMBER(3, 3),
+    /**
+     * <code>ALL = 4;</code>
+     *
+     * <pre>
+     * can be used in a WHERE clause with all the comparison operators
+     * </pre>
+     */
+    ALL(4, 4),
+    ;
+
+    /**
+     * <code>UNKNOWN_SEARCHABILITY = 0;</code>
+     */
+    public static final int UNKNOWN_SEARCHABILITY_VALUE = 0;
+    /**
+     * <code>NONE = 1;</code>
+     *
+     * <pre>
+     * can't be used in WHERE clause
+     * </pre>
+     */
+    public static final int NONE_VALUE = 1;
+    /**
+     * <code>CHAR = 2;</code>
+     *
+     * <pre>
+     * can be used in WHERE clause but only with LIKE predicate
+     * </pre>
+     */
+    public static final int CHAR_VALUE = 2;
+    /**
+     * <code>NUMBER = 3;</code>
+     *
+     * <pre>
+     * can be used in a WHERE clause with all the comparison operators except LIKE
+     * </pre>
+     */
+    public static final int NUMBER_VALUE = 3;
+    /**
+     * <code>ALL = 4;</code>
+     *
+     * <pre>
+     * can be used in a WHERE clause with all the comparison operators
+     * </pre>
+     */
+    public static final int ALL_VALUE = 4;
+
+
+    public final int getNumber() { return value; }
+
+    public static ColumnSearchability valueOf(int value) {
+      switch (value) {
+        case 0: return UNKNOWN_SEARCHABILITY;
+        case 1: return NONE;
+        case 2: return CHAR;
+        case 3: return NUMBER;
+        case 4: return ALL;
+        default: return null;
+      }
+    }
+
+    public static com.google.protobuf.Internal.EnumLiteMap<ColumnSearchability>
+        internalGetValueMap() {
+      return internalValueMap;
+    }
+    private static com.google.protobuf.Internal.EnumLiteMap<ColumnSearchability>
+        internalValueMap =
+          new com.google.protobuf.Internal.EnumLiteMap<ColumnSearchability>() {
+            public ColumnSearchability findValueByNumber(int number) {
+              return ColumnSearchability.valueOf(number);
+            }
+          };
+
+    public final com.google.protobuf.Descriptors.EnumValueDescriptor
+        getValueDescriptor() {
+      return getDescriptor().getValues().get(index);
+    }
+    public final com.google.protobuf.Descriptors.EnumDescriptor
+        getDescriptorForType() {
+      return getDescriptor();
+    }
+    public static final com.google.protobuf.Descriptors.EnumDescriptor
+        getDescriptor() {
+      return org.apache.drill.exec.proto.UserProtos.getDescriptor().getEnumTypes().get(4);
+    }
+
+    private static final ColumnSearchability[] VALUES = values();
+
+    public static ColumnSearchability valueOf(
+        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+      if (desc.getType() != getDescriptor()) {
+        throw new java.lang.IllegalArgumentException(
+          "EnumValueDescriptor is not for this type.");
+      }
+      return VALUES[desc.getIndex()];
+    }
+
+    private final int index;
+    private final int value;
+
+    private ColumnSearchability(int index, int value) {
+      this.index = index;
+      this.value = value;
+    }
+
+    // @@protoc_insertion_point(enum_scope:exec.user.ColumnSearchability)
+  }
+
+  /**
+   * Protobuf enum {@code exec.user.ColumnUpdatability}
+   *
+   * <pre>
+   *
+   * Whether a column can be updatable.
+   * </pre>
+   */
+  public enum ColumnUpdatability
+      implements com.google.protobuf.ProtocolMessageEnum {
+    /**
+     * <code>UNKNOWN_UPDATABILITY = 0;</code>
+     */
+    UNKNOWN_UPDATABILITY(0, 0),
+    /**
+     * <code>READ_ONLY = 1;</code>
+     */
+    READ_ONLY(1, 1),
+    /**
+     * <code>WRITABLE = 2;</code>
+     */
+    WRITABLE(2, 2),
+    ;
+
+    /**
+     * <code>UNKNOWN_UPDATABILITY = 0;</code>
+     */
+    public static final int UNKNOWN_UPDATABILITY_VALUE = 0;
+    /**
+     * <code>READ_ONLY = 1;</code>
+     */
+    public static final int READ_ONLY_VALUE = 1;
+    /**
+     * <code>WRITABLE = 2;</code>
+     */
+    public static final int WRITABLE_VALUE = 2;
+
+
+    public final int getNumber() { return value; }
+
+    public static ColumnUpdatability valueOf(int value) {
+      switch (value) {
+        case 0: return UNKNOWN_UPDATABILITY;
+        case 1: return READ_ONLY;
+        case 2: return WRITABLE;
+        default: return null;
+      }
+    }
+
+    public static com.google.protobuf.Internal.EnumLiteMap<ColumnUpdatability>
+        internalGetValueMap() {
+      return internalValueMap;
+    }
+    private static com.google.protobuf.Internal.EnumLiteMap<ColumnUpdatability>
+        internalValueMap =
+          new com.google.protobuf.Internal.EnumLiteMap<ColumnUpdatability>() {
+            public ColumnUpdatability findValueByNumber(int number) {
+              return ColumnUpdatability.valueOf(number);
+            }
+          };
+
+    public final com.google.protobuf.Descriptors.EnumValueDescriptor
+        getValueDescriptor() {
+      return getDescriptor().getValues().get(index);
+    }
+    public final com.google.protobuf.Descriptors.EnumDescriptor
+        getDescriptorForType() {
+      return getDescriptor();
+    }
+    public static final com.google.protobuf.Descriptors.EnumDescriptor
+        getDescriptor() {
+      return org.apache.drill.exec.proto.UserProtos.getDescriptor().getEnumTypes().get(5);
+    }
+
+    private static final ColumnUpdatability[] VALUES = values();
+
+    public static ColumnUpdatability valueOf(
+        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+      if (desc.getType() != getDescriptor()) {
+        throw new java.lang.IllegalArgumentException(
+          "EnumValueDescriptor is not for this type.");
+      }
+      return VALUES[desc.getIndex()];
+    }
+
+    private final int index;
+    private final int value;
+
+    private ColumnUpdatability(int index, int value) {
+      this.index = index;
+      this.value = value;
+    }
+
+    // @@protoc_insertion_point(enum_scope:exec.user.ColumnUpdatability)
+  }
+
   public interface PropertyOrBuilder
       extends com.google.protobuf.MessageOrBuilder {
 
@@ -3762,18 +4057,23 @@ public final class UserProtos {
     // @@protoc_insertion_point(class_scope:exec.user.RequestResults)
   }
 
-  public interface RunQueryOrBuilder
+  public interface GetQueryPlanFragmentsOrBuilder
       extends com.google.protobuf.MessageOrBuilder {
 
-    // optional .exec.user.QueryResultsMode results_mode = 1;
+    // required string query = 1;
     /**
-     * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+     * <code>required string query = 1;</code>
      */
-    boolean hasResultsMode();
+    boolean hasQuery();
     /**
-     * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+     * <code>required string query = 1;</code>
      */
-    org.apache.drill.exec.proto.UserProtos.QueryResultsMode getResultsMode();
+    java.lang.String getQuery();
+    /**
+     * <code>required string query = 1;</code>
+     */
+    com.google.protobuf.ByteString
+        getQueryBytes();
 
     // optional .exec.shared.QueryType type = 2;
     /**
@@ -3785,65 +4085,35 @@ public final class UserProtos {
      */
     org.apache.drill.exec.proto.UserBitShared.QueryType getType();
 
-    // optional string plan = 3;
-    /**
-     * <code>optional string plan = 3;</code>
-     */
-    boolean hasPlan();
-    /**
-     * <code>optional string plan = 3;</code>
-     */
-    java.lang.String getPlan();
-    /**
-     * <code>optional string plan = 3;</code>
-     */
-    com.google.protobuf.ByteString
-        getPlanBytes();
-
-    // repeated .exec.bit.control.PlanFragment fragments = 4;
-    /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-     */
-    java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> 
-        getFragmentsList();
-    /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-     */
-    org.apache.drill.exec.proto.BitControl.PlanFragment getFragments(int index);
-    /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-     */
-    int getFragmentsCount();
+    // optional bool split_plan = 3 [default = false];
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional bool split_plan = 3 [default = false];</code>
      */
-    java.util.List<? extends org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
-        getFragmentsOrBuilderList();
+    boolean hasSplitPlan();
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional bool split_plan = 3 [default = false];</code>
      */
-    org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder getFragmentsOrBuilder(
-        int index);
+    boolean getSplitPlan();
   }
   /**
-   * Protobuf type {@code exec.user.RunQuery}
+   * Protobuf type {@code exec.user.GetQueryPlanFragments}
    */
-  public static final class RunQuery extends
+  public static final class GetQueryPlanFragments extends
       com.google.protobuf.GeneratedMessage
-      implements RunQueryOrBuilder {
-    // Use RunQuery.newBuilder() to construct.
-    private RunQuery(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+      implements GetQueryPlanFragmentsOrBuilder {
+    // Use GetQueryPlanFragments.newBuilder() to construct.
+    private GetQueryPlanFragments(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
       super(builder);
       this.unknownFields = builder.getUnknownFields();
     }
-    private RunQuery(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+    private GetQueryPlanFragments(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
 
-    private static final RunQuery defaultInstance;
-    public static RunQuery getDefaultInstance() {
+    private static final GetQueryPlanFragments defaultInstance;
+    public static GetQueryPlanFragments getDefaultInstance() {
       return defaultInstance;
     }
 
-    public RunQuery getDefaultInstanceForType() {
+    public GetQueryPlanFragments getDefaultInstanceForType() {
       return defaultInstance;
     }
 
@@ -3853,7 +4123,7 @@ public final class UserProtos {
         getUnknownFields() {
       return this.unknownFields;
     }
-    private RunQuery(
+    private GetQueryPlanFragments(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -3876,15 +4146,9 @@ public final class UserProtos {
               }
               break;
             }
-            case 8: {
-              int rawValue = input.readEnum();
-              org.apache.drill.exec.proto.UserProtos.QueryResultsMode value = org.apache.drill.exec.proto.UserProtos.QueryResultsMode.valueOf(rawValue);
-              if (value == null) {
-                unknownFields.mergeVarintField(1, rawValue);
-              } else {
-                bitField0_ |= 0x00000001;
-                resultsMode_ = value;
-              }
+            case 10: {
+              bitField0_ |= 0x00000001;
+              query_ = input.readBytes();
               break;
             }
             case 16: {
@@ -3898,17 +4162,9 @@ public final class UserProtos {
               }
               break;
             }
-            case 26: {
+            case 24: {
               bitField0_ |= 0x00000004;
-              plan_ = input.readBytes();
-              break;
-            }
-            case 34: {
-              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-                fragments_ = new java.util.ArrayList<org.apache.drill.exec.proto.BitControl.PlanFragment>();
-                mutable_bitField0_ |= 0x00000008;
-              }
-              fragments_.add(input.readMessage(org.apache.drill.exec.proto.BitControl.PlanFragment.PARSER, extensionRegistry));
+              splitPlan_ = input.readBool();
               break;
             }
           }
@@ -3919,87 +4175,52 @@ public final class UserProtos {
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e.getMessage()).setUnfinishedMessage(this);
       } finally {
-        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
-          fragments_ = java.util.Collections.unmodifiableList(fragments_);
-        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
     }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RunQuery_descriptor;
+      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
     }
 
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RunQuery_fieldAccessorTable
+      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.apache.drill.exec.proto.UserProtos.RunQuery.class, org.apache.drill.exec.proto.UserProtos.RunQuery.Builder.class);
+              org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.Builder.class);
     }
 
-    public static com.google.protobuf.Parser<RunQuery> PARSER =
-        new com.google.protobuf.AbstractParser<RunQuery>() {
-      public RunQuery parsePartialFrom(
+    public static com.google.protobuf.Parser<GetQueryPlanFragments> PARSER =
+        new com.google.protobuf.AbstractParser<GetQueryPlanFragments>() {
+      public GetQueryPlanFragments parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new RunQuery(input, extensionRegistry);
+        return new GetQueryPlanFragments(input, extensionRegistry);
       }
     };
 
     @java.lang.Override
-    public com.google.protobuf.Parser<RunQuery> getParserForType() {
+    public com.google.protobuf.Parser<GetQueryPlanFragments> getParserForType() {
       return PARSER;
     }
 
     private int bitField0_;
-    // optional .exec.user.QueryResultsMode results_mode = 1;
-    public static final int RESULTS_MODE_FIELD_NUMBER = 1;
-    private org.apache.drill.exec.proto.UserProtos.QueryResultsMode resultsMode_;
+    // required string query = 1;
+    public static final int QUERY_FIELD_NUMBER = 1;
+    private java.lang.Object query_;
     /**
-     * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+     * <code>required string query = 1;</code>
      */
-    public boolean hasResultsMode() {
+    public boolean hasQuery() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
-     */
-    public org.apache.drill.exec.proto.UserProtos.QueryResultsMode getResultsMode() {
-      return resultsMode_;
-    }
-
-    // optional .exec.shared.QueryType type = 2;
-    public static final int TYPE_FIELD_NUMBER = 2;
-    private org.apache.drill.exec.proto.UserBitShared.QueryType type_;
-    /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
-     */
-    public boolean hasType() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
-    }
-    /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
-     */
-    public org.apache.drill.exec.proto.UserBitShared.QueryType getType() {
-      return type_;
-    }
-
-    // optional string plan = 3;
-    public static final int PLAN_FIELD_NUMBER = 3;
-    private java.lang.Object plan_;
-    /**
-     * <code>optional string plan = 3;</code>
-     */
-    public boolean hasPlan() {
-      return ((bitField0_ & 0x00000004) == 0x00000004);
-    }
-    /**
-     * <code>optional string plan = 3;</code>
+     * <code>required string query = 1;</code>
      */
-    public java.lang.String getPlan() {
-      java.lang.Object ref = plan_;
+    public java.lang.String getQuery() {
+      java.lang.Object ref = query_;
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
@@ -4007,75 +4228,74 @@ public final class UserProtos {
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
-          plan_ = s;
+          query_ = s;
         }
         return s;
       }
     }
     /**
-     * <code>optional string plan = 3;</code>
+     * <code>required string query = 1;</code>
      */
     public com.google.protobuf.ByteString
-        getPlanBytes() {
-      java.lang.Object ref = plan_;
+        getQueryBytes() {
+      java.lang.Object ref = query_;
       if (ref instanceof java.lang.String) {
         com.google.protobuf.ByteString b = 
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
-        plan_ = b;
+        query_ = b;
         return b;
       } else {
         return (com.google.protobuf.ByteString) ref;
       }
     }
 
-    // repeated .exec.bit.control.PlanFragment fragments = 4;
-    public static final int FRAGMENTS_FIELD_NUMBER = 4;
-    private java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> fragments_;
-    /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-     */
-    public java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> getFragmentsList() {
-      return fragments_;
-    }
+    // optional .exec.shared.QueryType type = 2;
+    public static final int TYPE_FIELD_NUMBER = 2;
+    private org.apache.drill.exec.proto.UserBitShared.QueryType type_;
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional .exec.shared.QueryType type = 2;</code>
      */
-    public java.util.List<? extends org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
-        getFragmentsOrBuilderList() {
-      return fragments_;
+    public boolean hasType() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
     }
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional .exec.shared.QueryType type = 2;</code>
      */
-    public int getFragmentsCount() {
-      return fragments_.size();
+    public org.apache.drill.exec.proto.UserBitShared.QueryType getType() {
+      return type_;
     }
+
+    // optional bool split_plan = 3 [default = false];
+    public static final int SPLIT_PLAN_FIELD_NUMBER = 3;
+    private boolean splitPlan_;
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional bool split_plan = 3 [default = false];</code>
      */
-    public org.apache.drill.exec.proto.BitControl.PlanFragment getFragments(int index) {
-      return fragments_.get(index);
+    public boolean hasSplitPlan() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
+     * <code>optional bool split_plan = 3 [default = false];</code>
      */
-    public org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder getFragmentsOrBuilder(
-        int index) {
-      return fragments_.get(index);
+    public boolean getSplitPlan() {
+      return splitPlan_;
     }
 
     private void initFields() {
-      resultsMode_ = org.apache.drill.exec.proto.UserProtos.QueryResultsMode.STREAM_FULL;
+      query_ = "";
       type_ = org.apache.drill.exec.proto.UserBitShared.QueryType.SQL;
-      plan_ = "";
-      fragments_ = java.util.Collections.emptyList();
+      splitPlan_ = false;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
       if (isInitialized != -1) return isInitialized == 1;
 
+      if (!hasQuery()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
       memoizedIsInitialized = 1;
       return true;
     }
@@ -4084,16 +4304,13 @@ public final class UserProtos {
                         throws java.io.IOException {
       getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeEnum(1, resultsMode_.getNumber());
+        output.writeBytes(1, getQueryBytes());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         output.writeEnum(2, type_.getNumber());
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
-        output.writeBytes(3, getPlanBytes());
-      }
-      for (int i = 0; i < fragments_.size(); i++) {
-        output.writeMessage(4, fragments_.get(i));
+        output.writeBool(3, splitPlan_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -4106,7 +4323,7 @@ public final class UserProtos {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(1, resultsMode_.getNumber());
+          .computeBytesSize(1, getQueryBytes());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
@@ -4114,11 +4331,7 @@ public final class UserProtos {
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(3, getPlanBytes());
-      }
-      for (int i = 0; i < fragments_.size(); i++) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(4, fragments_.get(i));
+          .computeBoolSize(3, splitPlan_);
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
@@ -4132,53 +4345,53 @@ public final class UserProtos {
       return super.writeReplace();
     }
 
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(byte[] data)
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(java.io.InputStream input)
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseFrom(input, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseDelimitedFrom(java.io.InputStream input)
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseDelimitedFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.RunQuery parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
@@ -4187,7 +4400,7 @@ public final class UserProtos {
 
     public static Builder newBuilder() { return Builder.create(); }
     public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.RunQuery prototype) {
+    public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments prototype) {
       return newBuilder().mergeFrom(prototype);
     }
     public Builder toBuilder() { return newBuilder(this); }
@@ -4199,24 +4412,24 @@ public final class UserProtos {
       return builder;
     }
     /**
-     * Protobuf type {@code exec.user.RunQuery}
+     * Protobuf type {@code exec.user.GetQueryPlanFragments}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessage.Builder<Builder>
-       implements org.apache.drill.exec.proto.UserProtos.RunQueryOrBuilder {
+       implements org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragmentsOrBuilder {
       public static final com.google.protobuf.Descriptors.Descriptor
           getDescriptor() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RunQuery_descriptor;
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
       }
 
       protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RunQuery_fieldAccessorTable
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
-                org.apache.drill.exec.proto.UserProtos.RunQuery.class, org.apache.drill.exec.proto.UserProtos.RunQuery.Builder.class);
+                org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.Builder.class);
       }
 
-      // Construct using org.apache.drill.exec.proto.UserProtos.RunQuery.newBuilder()
+      // Construct using org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.newBuilder()
       private Builder() {
         maybeForceBuilderInitialization();
       }
@@ -4228,7 +4441,6 @@ public final class UserProtos {
       }
       private void maybeForceBuilderInitialization() {
         if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
-          getFragmentsFieldBuilder();
         }
       }
       private static Builder create() {
@@ -4237,18 +4449,12 @@ public final class UserProtos {
 
       public Builder clear() {
         super.clear();
-        resultsMode_ = org.apache.drill.exec.proto.UserProtos.QueryResultsMode.STREAM_FULL;
+        query_ = "";
         bitField0_ = (bitField0_ & ~0x00000001);
         type_ = org.apache.drill.exec.proto.UserBitShared.QueryType.SQL;
         bitField0_ = (bitField0_ & ~0x00000002);
-        plan_ = "";
+        splitPlan_ = false;
         bitField0_ = (bitField0_ & ~0x00000004);
-        if (fragmentsBuilder_ == null) {
-          fragments_ = java.util.Collections.emptyList();
-          bitField0_ = (bitField0_ & ~0x00000008);
-        } else {
-          fragmentsBuilder_.clear();
-        }
         return this;
       }
 
@@ -4258,29 +4464,29 @@ public final class UserProtos {
 
       public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RunQuery_descriptor;
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
       }
 
-      public org.apache.drill.exec.proto.UserProtos.RunQuery getDefaultInstanceForType() {
-        return org.apache.drill.exec.proto.UserProtos.RunQuery.getDefaultInstance();
+      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments getDefaultInstanceForType() {
+        return org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.getDefaultInstance();
       }
 
-      public org.apache.drill.exec.proto.UserProtos.RunQuery build() {
-        org.apache.drill.exec.proto.UserProtos.RunQuery result = buildPartial();
+      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments build() {
+        org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
         return result;
       }
 
-      public org.apache.drill.exec.proto.UserProtos.RunQuery buildPartial() {
-        org.apache.drill.exec.proto.UserProtos.RunQuery result = new org.apache.drill.exec.proto.UserProtos.RunQuery(this);
+      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments buildPartial() {
+        org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments result = new org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
           to_bitField0_ |= 0x00000001;
         }
-        result.resultsMode_ = resultsMode_;
+        result.query_ = query_;
         if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
           to_bitField0_ |= 0x00000002;
         }
@@ -4288,74 +4494,43 @@ public final class UserProtos {
         if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
           to_bitField0_ |= 0x00000004;
         }
-        result.plan_ = plan_;
-        if (fragmentsBuilder_ == null) {
-          if (((bitField0_ & 0x00000008) == 0x00000008)) {
-            fragments_ = java.util.Collections.unmodifiableList(fragments_);
-            bitField0_ = (bitField0_ & ~0x00000008);
-          }
-          result.fragments_ = fragments_;
-        } else {
-          result.fragments_ = fragmentsBuilder_.build();
-        }
+        result.splitPlan_ = splitPlan_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
       }
 
       public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof org.apache.drill.exec.proto.UserProtos.RunQuery) {
-          return mergeFrom((org.apache.drill.exec.proto.UserProtos.RunQuery)other);
+        if (other instanceof org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments) {
+          return mergeFrom((org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments)other);
         } else {
           super.mergeFrom(other);
           return this;
         }
       }
 
-      public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.RunQuery other) {
-        if (other == org.apache.drill.exec.proto.UserProtos.RunQuery.getDefaultInstance()) return this;
-        if (other.hasResultsMode()) {
-          setResultsMode(other.getResultsMode());
+      public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments other) {
+        if (other == org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.getDefaultInstance()) return this;
+        if (other.hasQuery()) {
+          bitField0_ |= 0x00000001;
+          query_ = other.query_;
+          onChanged();
         }
         if (other.hasType()) {
           setType(other.getType());
         }
-        if (other.hasPlan()) {
-          bitField0_ |= 0x00000004;
-          plan_ = other.plan_;
-          onChanged();
-        }
-        if (fragmentsBuilder_ == null) {
-          if (!other.fragments_.isEmpty()) {
-            if (fragments_.isEmpty()) {
-              fragments_ = other.fragments_;
-              bitField0_ = (bitField0_ & ~0x00000008);
-            } else {
-              ensureFragmentsIsMutable();
-              fragments_.addAll(other.fragments_);
-            }
-            onChanged();
-          }
-        } else {
-          if (!other.fragments_.isEmpty()) {
-            if (fragmentsBuilder_.isEmpty()) {
-              fragmentsBuilder_.dispose();
-              fragmentsBuilder_ = null;
-              fragments_ = other.fragments_;
-              bitField0_ = (bitField0_ & ~0x00000008);
-              fragmentsBuilder_ = 
-                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
-                   getFragmentsFieldBuilder() : null;
-            } else {
-              fragmentsBuilder_.addAllMessages(other.fragments_);
-            }
-          }
+        if (other.hasSplitPlan()) {
+          setSplitPlan(other.getSplitPlan());
         }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
       public final boolean isInitialized() {
+        if (!hasQuery()) {
+          
+          return false;
+        }
         return true;
       }
 
@@ -4363,11 +4538,11 @@ public final class UserProtos {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        org.apache.drill.exec.proto.UserProtos.RunQuery parsedMessage = null;
+        org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parsedMessage = null;
         try {
           parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.apache.drill.exec.proto.UserProtos.RunQuery) e.getUnfinishedMessage();
+          parsedMessage = (org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments) e.getUnfinishedMessage();
           throw e;
         } finally {
           if (parsedMessage != null) {
@@ -4378,38 +4553,76 @@ public final class UserProtos {
       }
       private int bitField0_;
 
-      // optional .exec.user.QueryResultsMode results_mode = 1;
-      private org.apache.drill.exec.proto.UserProtos.QueryResultsMode resultsMode_ = org.apache.drill.exec.proto.UserProtos.QueryResultsMode.STREAM_FULL;
+      // required string query = 1;
+      private java.lang.Object query_ = "";
       /**
-       * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+       * <code>required string query = 1;</code>
        */
-      public boolean hasResultsMode() {
+      public boolean hasQuery() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
-       * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+       * <code>required string query = 1;</code>
        */
-      public org.apache.drill.exec.proto.UserProtos.QueryResultsMode getResultsMode() {
-        return resultsMode_;
+      public java.lang.String getQuery() {
+        java.lang.Object ref = query_;
+        if (!(ref instanceof java.lang.String)) {
+          java.lang.String s = ((com.google.protobuf.ByteString) ref)
+              .toStringUtf8();
+          query_ = s;
+          return s;
+        } else {
+          return (java.lang.String) ref;
+        }
       }
       /**
-       * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+       * <code>required string query = 1;</code>
        */
-      public Builder setResultsMode(org.apache.drill.exec.proto.UserProtos.QueryResultsMode value) {
-        if (value == null) {
-          throw new NullPointerException();
+      public com.google.protobuf.ByteString
+          getQueryBytes() {
+        java.lang.Object ref = query_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (java.lang.String) ref);
+          query_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
         }
-        bitField0_ |= 0x00000001;
-        resultsMode_ = value;
+      }
+      /**
+       * <code>required string query = 1;</code>
+       */
+      public Builder setQuery(
+          java.lang.String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000001;
+        query_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional .exec.user.QueryResultsMode results_mode = 1;</code>
+       * <code>required string query = 1;</code>
        */
-      public Builder clearResultsMode() {
+      public Builder clearQuery() {
         bitField0_ = (bitField0_ & ~0x00000001);
-        resultsMode_ = org.apache.drill.exec.proto.UserProtos.QueryResultsMode.STREAM_FULL;
+        query_ = getDefaultInstance().getQuery();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>required string query = 1;</code>
+       */
+      public Builder setQueryBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000001;
+        query_ = value;
         onChanged();
         return this;
       }
@@ -4450,388 +4663,135 @@ public final class UserProtos {
         return this;
       }
 
-      // optional string plan = 3;
-      private java.lang.Object plan_ = "";
+      // optional bool split_plan = 3 [default = false];
+      private boolean splitPlan_ ;
       /**
-       * <code>optional string plan = 3;</code>
+       * <code>optional bool split_plan = 3 [default = false];</code>
        */
-      public boolean hasPlan() {
+      public boolean hasSplitPlan() {
         return ((bitField0_ & 0x00000004) == 0x00000004);
       }
       /**
-       * <code>optional string plan = 3;</code>
-       */
-      public java.lang.String getPlan() {
-        java.lang.Object ref = plan_;
-        if (!(ref instanceof java.lang.String)) {
-          java.lang.String s = ((com.google.protobuf.ByteString) ref)
-              .toStringUtf8();
-          plan_ = s;
-          return s;
-        } else {
-          return (java.lang.String) ref;
-        }
-      }
-      /**
-       * <code>optional string plan = 3;</code>
+       * <code>optional bool split_plan = 3 [default = false];</code>
        */
-      public com.google.protobuf.ByteString
-          getPlanBytes() {
-        java.lang.Object ref = plan_;
-        if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
-              com.google.protobuf.ByteString.copyFromUtf8(
-                  (java.lang.String) ref);
-          plan_ = b;
-          return b;
-        } else {
-          return (com.google.protobuf.ByteString) ref;
-        }
+      public boolean getSplitPlan() {
+        return splitPlan_;
       }
       /**
-       * <code>optional string plan = 3;</code>
+       * <code>optional bool split_plan = 3 [default = false];</code>
        */
-      public Builder setPlan(
-          java.lang.String value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000004;
-        plan_ = value;
+      public Builder setSplitPlan(boolean value) {
+        bitField0_ |= 0x00000004;
+        splitPlan_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional string plan = 3;</code>
+       * <code>optional bool split_plan = 3 [default = false];</code>
        */
-      public Builder clearPlan() {
+      public Builder clearSplitPlan() {
         bitField0_ = (bitField0_ & ~0x00000004);
-        plan_ = getDefaultInstance().getPlan();
+        splitPlan_ = false;
         onChanged();
         return this;
       }
-      /**
-       * <code>optional string plan = 3;</code>
-       */
-      public Builder setPlanBytes(
-          com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
+
+      // @@protoc_insertion_point(builder_scope:exec.user.GetQueryPlanFragments)
+    }
+
+    static {
+      defaultInstance = new GetQueryPlanFragments(true);
+      defaultInstance.initFields();
+    }
+
+    // @@protoc_insertion_point(class_scope:exec.user.GetQueryPlanFragments)
   }
-  bitField0_ |= 0x00000004;
-        plan_ = value;
-        onChanged();
-        return this;
-      }
 
-      // repeated .exec.bit.control.PlanFragment fragments = 4;
-      private java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> fragments_ =
-        java.util.Collections.emptyList();
-      private void ensureFragmentsIsMutable() {
-        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
-          fragments_ = new java.util.ArrayList<org.apache.drill.exec.proto.BitControl.PlanFragment>(fragments_);
-          bitField0_ |= 0x00000008;
-         }
-      }
+  public interface QueryPlanFragmentsOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
 
-      private com.google.protobuf.RepeatedFieldBuilder<
-          org.apache.drill.exec.proto.BitControl.PlanFragment, org.apache.drill.exec.proto.BitControl.PlanFragment.Builder, org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> fragmentsBuilder_;
+    // required .exec.shared.QueryResult.QueryState status = 1;
+    /**
+     * <code>required .exec.shared.QueryResult.QueryState status = 1;</code>
+     */
+    boolean hasStatus();
+    /**
+     * <code>required .exec.shared.QueryResult.QueryState status = 1;</code>
+     */
+    org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState getStatus();
 
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> getFragmentsList() {
-        if (fragmentsBuilder_ == null) {
-          return java.util.Collections.unmodifiableList(fragments_);
-        } else {
-          return fragmentsBuilder_.getMessageList();
-        }
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public int getFragmentsCount() {
-        if (fragmentsBuilder_ == null) {
-          return fragments_.size();
-        } else {
-          return fragmentsBuilder_.getCount();
-        }
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public org.apache.drill.exec.proto.BitControl.PlanFragment getFragments(int index) {
-        if (fragmentsBuilder_ == null) {
-          return fragments_.get(index);
-        } else {
-          return fragmentsBuilder_.getMessage(index);
-        }
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder setFragments(
-          int index, org.apache.drill.exec.proto.BitControl.PlanFragment value) {
-        if (fragmentsBuilder_ == null) {
-          if (value == null) {
-            throw new NullPointerException();
-          }
-          ensureFragmentsIsMutable();
-          fragments_.set(index, value);
-          onChanged();
-        } else {
-          fragmentsBuilder_.setMessage(index, value);
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder setFragments(
-          int index, org.apache.drill.exec.proto.BitControl.PlanFragment.Builder builderForValue) {
-        if (fragmentsBuilder_ == null) {
-          ensureFragmentsIsMutable();
-          fragments_.set(index, builderForValue.build());
-          onChanged();
-        } else {
-          fragmentsBuilder_.setMessage(index, builderForValue.build());
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder addFragments(org.apache.drill.exec.proto.BitControl.PlanFragment value) {
-        if (fragmentsBuilder_ == null) {
-          if (value == null) {
-            throw new NullPointerException();
-          }
-          ensureFragmentsIsMutable();
-          fragments_.add(value);
-          onChanged();
-        } else {
-          fragmentsBuilder_.addMessage(value);
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder addFragments(
-          int index, org.apache.drill.exec.proto.BitControl.PlanFragment value) {
-        if (fragmentsBuilder_ == null) {
-          if (value == null) {
-            throw new NullPointerException();
-          }
-          ensureFragmentsIsMutable();
-          fragments_.add(index, value);
-          onChanged();
-        } else {
-          fragmentsBuilder_.addMessage(index, value);
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder addFragments(
-          org.apache.drill.exec.proto.BitControl.PlanFragment.Builder builderForValue) {
-        if (fragmentsBuilder_ == null) {
-          ensureFragmentsIsMutable();
-          fragments_.add(builderForValue.build());
-          onChanged();
-        } else {
-          fragmentsBuilder_.addMessage(builderForValue.build());
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder addFragments(
-          int index, org.apache.drill.exec.proto.BitControl.PlanFragment.Builder builderForValue) {
-        if (fragmentsBuilder_ == null) {
-          ensureFragmentsIsMutable();
-          fragments_.add(index, builderForValue.build());
-          onChanged();
-        } else {
-          fragmentsBuilder_.addMessage(index, builderForValue.build());
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder addAllFragments(
-          java.lang.Iterable<? extends org.apache.drill.exec.proto.BitControl.PlanFragment> values) {
-        if (fragmentsBuilder_ == null) {
-          ensureFragmentsIsMutable();
-          super.addAll(values, fragments_);
-          onChanged();
-        } else {
-          fragmentsBuilder_.addAllMessages(values);
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder clearFragments() {
-        if (fragmentsBuilder_ == null) {
-          fragments_ = java.util.Collections.emptyList();
-          bitField0_ = (bitField0_ & ~0x00000008);
-          onChanged();
-        } else {
-          fragmentsBuilder_.clear();
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public Builder removeFragments(int index) {
-        if (fragmentsBuilder_ == null) {
-          ensureFragmentsIsMutable();
-          fragments_.remove(index);
-          onChanged();
-        } else {
-          fragmentsBuilder_.remove(index);
-        }
-        return this;
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public org.apache.drill.exec.proto.BitControl.PlanFragment.Builder getFragmentsBuilder(
-          int index) {
-        return getFragmentsFieldBuilder().getBuilder(index);
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder getFragmentsOrBuilder(
-          int index) {
-        if (fragmentsBuilder_ == null) {
-          return fragments_.get(index);  } else {
-          return fragmentsBuilder_.getMessageOrBuilder(index);
-        }
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public java.util.List<? extends org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
-           getFragmentsOrBuilderList() {
-        if (fragmentsBuilder_ != null) {
-          return fragmentsBuilder_.getMessageOrBuilderList();
-        } else {
-          return java.util.Collections.unmodifiableList(fragments_);
-        }
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public org.apache.drill.exec.proto.BitControl.PlanFragment.Builder addFragmentsBuilder() {
-        return getFragmentsFieldBuilder().addBuilder(
-            org.apache.drill.exec.proto.BitControl.PlanFragment.getDefaultInstance());
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public org.apache.drill.exec.proto.BitControl.PlanFragment.Builder addFragmentsBuilder(
-          int index) {
-        return getFragmentsFieldBuilder().addBuilder(
-            index, org.apache.drill.exec.proto.BitControl.PlanFragment.getDefaultInstance());
-      }
-      /**
-       * <code>repeated .exec.bit.control.PlanFragment fragments = 4;</code>
-       */
-      public java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment.Builder> 
-           getFragmentsBuilderList() {
-        return getFragmentsFieldBuilder().getBuilderList();
-      }
-      private com.google.protobuf.RepeatedFieldBuilder<
-          org.apache.drill.exec.proto.BitControl.PlanFragment, org.apache.drill.exec.proto.BitControl.PlanFragment.Builder, org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
-          getFragmentsFieldBuilder() {
-        if (fragmentsBuilder_ == null) {
-          fragmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
-              org.apache.drill.exec.proto.BitControl.PlanFragment, org.apache.drill.exec.proto.BitControl.PlanFragment.Builder, org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder>(
-                  fragments_,
-                  ((bitField0_ & 0x00000008) == 0x00000008),
-                  getParentForChildren(),
-                  isClean());
-          fragments_ = null;
-        }
-        return fragmentsBuilder_;
-      }
-
-      // @@protoc_insertion_point(builder_scope:exec.user.RunQuery)
-    }
-
-    static {
-      defaultInstance = new RunQuery(true);
-      defaultInstance.initFields();
-    }
-
-    // @@protoc_insertion_point(class_scope:exec.user.RunQuery)
-  }
-
-  public interface GetQueryPlanFragmentsOrBuilder
-      extends com.google.protobuf.MessageOrBuilder {
-
-    // required string query = 1;
+    // optional .exec.shared.QueryId query_id = 2;
     /**
-     * <code>required string query = 1;</code>
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
      */
-    boolean hasQuery();
+    boolean hasQueryId();
     /**
-     * <code>required string query = 1;</code>
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
      */
-    java.lang.String getQuery();
+    org.apache.drill.exec.proto.UserBitShared.QueryId getQueryId();
     /**
-     * <code>required string query = 1;</code>
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
      */
-    com.google.protobuf.ByteString
-        getQueryBytes();
+    org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder getQueryIdOrBuilder();
 
-    // optional .exec.shared.QueryType type = 2;
+    // repeated .exec.bit.control.PlanFragment fragments = 3;
     /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    boolean hasType();
+    java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> 
+        getFragmentsList();
     /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    org.apache.drill.exec.proto.UserBitShared.QueryType getType();
-
-    // optional bool split_plan = 3 [default = false];
+    org.apache.drill.exec.proto.BitControl.PlanFragment getFragments(int index);
     /**
-     * <code>optional bool split_plan = 3 [default = false];</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    boolean hasSplitPlan();
+    int getFragmentsCount();
     /**
-     * <code>optional bool split_plan = 3 [default = false];</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    boolean getSplitPlan();
-  }
-  /**
-   * Protobuf type {@code exec.user.GetQueryPlanFragments}
-   */
-  public static final class GetQueryPlanFragments extends
-      com.google.protobuf.GeneratedMessage
-      implements GetQueryPlanFragmentsOrBuilder {
-    // Use GetQueryPlanFragments.newBuilder() to construct.
-    private GetQueryPlanFragments(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private GetQueryPlanFragments(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+    java.util.List<? extends org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
+        getFragmentsOrBuilderList();
+    /**
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
+     */
+    org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder getFragmentsOrBuilder(
+        int index);
 
-    private static final GetQueryPlanFragments defaultInstance;
-    public static GetQueryPlanFragments getDefaultInstance() {
+    // optional .exec.shared.DrillPBError error = 4;
+    /**
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
+     */
+    boolean hasError();
+    /**
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
+     */
+    org.apache.drill.exec.proto.UserBitShared.DrillPBError getError();
+    /**
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
+     */
+    org.apache.drill.exec.proto.UserBitShared.DrillPBErrorOrBuilder getErrorOrBuilder();
+  }
+  /**
+   * Protobuf type {@code exec.user.QueryPlanFragments}
+   */
+  public static final class QueryPlanFragments extends
+      com.google.protobuf.GeneratedMessage
+      implements QueryPlanFragmentsOrBuilder {
+    // Use QueryPlanFragments.newBuilder() to construct.
+    private QueryPlanFragments(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+      super(builder);
+      this.unknownFields = builder.getUnknownFields();
+    }
+    private QueryPlanFragments(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+    private static final QueryPlanFragments defaultInstance;
+    public static QueryPlanFragments getDefaultInstance() {
       return defaultInstance;
     }
 
-    public GetQueryPlanFragments getDefaultInstanceForType() {
+    public QueryPlanFragments getDefaultInstanceForType() {
       return defaultInstance;
     }
 
@@ -4841,7 +4801,7 @@ public final class UserProtos {
         getUnknownFields() {
       return this.unknownFields;
     }
-    private GetQueryPlanFragments(
+    private QueryPlanFragments(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -4864,25 +4824,49 @@ public final class UserProtos {
               }
               break;
             }
-            case 10: {
-              bitField0_ |= 0x00000001;
-              query_ = input.readBytes();
-              break;
-            }
-            case 16: {
+            case 8: {
               int rawValue = input.readEnum();
-              org.apache.drill.exec.proto.UserBitShared.QueryType value = org.apache.drill.exec.proto.UserBitShared.QueryType.valueOf(rawValue);
+              org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState value = org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState.valueOf(rawValue);
               if (value == null) {
-                unknownFields.mergeVarintField(2, rawValue);
+                unknownFields.mergeVarintField(1, rawValue);
               } else {
-                bitField0_ |= 0x00000002;
-                type_ = value;
+                bitField0_ |= 0x00000001;
+                status_ = value;
               }
               break;
             }
-            case 24: {
+            case 18: {
+              org.apache.drill.exec.proto.UserBitShared.QueryId.Builder subBuilder = null;
+              if (((bitField0_ & 0x00000002) == 0x00000002)) {
+                subBuilder = queryId_.toBuilder();
+              }
+              queryId_ = input.readMessage(org.apache.drill.exec.proto.UserBitShared.QueryId.PARSER, extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(queryId_);
+                queryId_ = subBuilder.buildPartial();
+              }
+              bitField0_ |= 0x00000002;
+              break;
+            }
+            case 26: {
+              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+                fragments_ = new java.util.ArrayList<org.apache.drill.exec.proto.BitControl.PlanFragment>();
+                mutable_bitField0_ |= 0x00000004;
+              }
+              fragments_.add(input.readMessage(org.apache.drill.exec.proto.BitControl.PlanFragment.PARSER, extensionRegistry));
+              break;
+            }
+            case 34: {
+              org.apache.drill.exec.proto.UserBitShared.DrillPBError.Builder subBuilder = null;
+              if (((bitField0_ & 0x00000004) == 0x00000004)) {
+                subBuilder = error_.toBuilder();
+              }
+              error_ = input.readMessage(org.apache.drill.exec.proto.UserBitShared.DrillPBError.PARSER, extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(error_);
+                error_ = subBuilder.buildPartial();
+              }
               bitField0_ |= 0x00000004;
-              splitPlan_ = input.readBool();
               break;
             }
           }
@@ -4893,124 +4877,149 @@ public final class UserProtos {
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e.getMessage()).setUnfinishedMessage(this);
       } finally {
+        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+          fragments_ = java.util.Collections.unmodifiableList(fragments_);
+        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
     }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
+      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_QueryPlanFragments_descriptor;
     }
 
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_fieldAccessorTable
+      return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_QueryPlanFragments_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.Builder.class);
+              org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.Builder.class);
     }
 
-    public static com.google.protobuf.Parser<GetQueryPlanFragments> PARSER =
-        new com.google.protobuf.AbstractParser<GetQueryPlanFragments>() {
-      public GetQueryPlanFragments parsePartialFrom(
+    public static com.google.protobuf.Parser<QueryPlanFragments> PARSER =
+        new com.google.protobuf.AbstractParser<QueryPlanFragments>() {
+      public QueryPlanFragments parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new GetQueryPlanFragments(input, extensionRegistry);
+        return new QueryPlanFragments(input, extensionRegistry);
       }
     };
 
     @java.lang.Override
-    public com.google.protobuf.Parser<GetQueryPlanFragments> getParserForType() {
+    public com.google.protobuf.Parser<QueryPlanFragments> getParserForType() {
       return PARSER;
     }
 
     private int bitField0_;
-    // required string query = 1;
-    public static final int QUERY_FIELD_NUMBER = 1;
-    private java.lang.Object query_;
+    // required .exec.shared.QueryResult.QueryState status = 1;
+    public static final int STATUS_FIELD_NUMBER = 1;
+    private org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState status_;
     /**
-     * <code>required string query = 1;</code>
+     * <code>required .exec.shared.QueryResult.QueryState status = 1;</code>
      */
-    public boolean hasQuery() {
+    public boolean hasStatus() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
-     * <code>required string query = 1;</code>
+     * <code>required .exec.shared.QueryResult.QueryState status = 1;</code>
      */
-    public java.lang.String getQuery() {
-      java.lang.Object ref = query_;
-      if (ref instanceof java.lang.String) {
-        return (java.lang.String) ref;
-      } else {
-        com.google.protobuf.ByteString bs = 
-            (com.google.protobuf.ByteString) ref;
-        java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          query_ = s;
-        }
-        return s;
-      }
+    public org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState getStatus() {
+      return status_;
     }
+
+    // optional .exec.shared.QueryId query_id = 2;
+    public static final int QUERY_ID_FIELD_NUMBER = 2;
+    private org.apache.drill.exec.proto.UserBitShared.QueryId queryId_;
     /**
-     * <code>required string query = 1;</code>
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
      */
-    public com.google.protobuf.ByteString
-        getQueryBytes() {
-      java.lang.Object ref = query_;
-      if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
-            com.google.protobuf.ByteString.copyFromUtf8(
-                (java.lang.String) ref);
-        query_ = b;
-        return b;
-      } else {
-        return (com.google.protobuf.ByteString) ref;
-      }
+    public boolean hasQueryId() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
+    }
+    /**
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
+     */
+    public org.apache.drill.exec.proto.UserBitShared.QueryId getQueryId() {
+      return queryId_;
+    }
+    /**
+     * <code>optional .exec.shared.QueryId query_id = 2;</code>
+     */
+    public org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder getQueryIdOrBuilder() {
+      return queryId_;
     }
 
-    // optional .exec.shared.QueryType type = 2;
-    public static final int TYPE_FIELD_NUMBER = 2;
-    private org.apache.drill.exec.proto.UserBitShared.QueryType type_;
+    // repeated .exec.bit.control.PlanFragment fragments = 3;
+    public static final int FRAGMENTS_FIELD_NUMBER = 3;
+    private java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> fragments_;
     /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    public boolean hasType() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
+    public java.util.List<org.apache.drill.exec.proto.BitControl.PlanFragment> getFragmentsList() {
+      return fragments_;
     }
     /**
-     * <code>optional .exec.shared.QueryType type = 2;</code>
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
      */
-    public org.apache.drill.exec.proto.UserBitShared.QueryType getType() {
-      return type_;
+    public java.util.List<? extends org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder> 
+        getFragmentsOrBuilderList() {
+      return fragments_;
+    }
+    /**
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
+     */
+    public int getFragmentsCount() {
+      return fragments_.size();
+    }
+    /**
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
+     */
+    public org.apache.drill.exec.proto.BitControl.PlanFragment getFragments(int index) {
+      return fragments_.get(index);
+    }
+    /**
+     * <code>repeated .exec.bit.control.PlanFragment fragments = 3;</code>
+     */
+    public org.apache.drill.exec.proto.BitControl.PlanFragmentOrBuilder getFragmentsOrBuilder(
+        int index) {
+      return fragments_.get(index);
     }
 
-    // optional bool split_plan = 3 [default = false];
-    public static final int SPLIT_PLAN_FIELD_NUMBER = 3;
-    private boolean splitPlan_;
+    // optional .exec.shared.DrillPBError error = 4;
+    public static final int ERROR_FIELD_NUMBER = 4;
+    private org.apache.drill.exec.proto.UserBitShared.DrillPBError error_;
     /**
-     * <code>optional bool split_plan = 3 [default = false];</code>
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
      */
-    public boolean hasSplitPlan() {
+    public boolean hasError() {
       return ((bitField0_ & 0x00000004) == 0x00000004);
     }
     /**
-     * <code>optional bool split_plan = 3 [default = false];</code>
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
      */
-    public boolean getSplitPlan() {
-      return splitPlan_;
+    public org.apache.drill.exec.proto.UserBitShared.DrillPBError getError() {
+      return error_;
+    }
+    /**
+     * <code>optional .exec.shared.DrillPBError error = 4;</code>
+     */
+    public org.apache.drill.exec.proto.UserBitShared.DrillPBErrorOrBuilder getErrorOrBuilder() {
+      return error_;
     }
 
     private void initFields() {
-      query_ = "";
-      type_ = org.apache.drill.exec.proto.UserBitShared.QueryType.SQL;
-      splitPlan_ = false;
+      status_ = org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState.STARTING;
+      queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
+      fragments_ = java.util.Collections.emptyList();
+      error_ = org.apache.drill.exec.proto.UserBitShared.DrillPBError.getDefaultInstance();
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
       if (isInitialized != -1) return isInitialized == 1;
 
-      if (!hasQuery()) {
+      if (!hasStatus()) {
         memoizedIsInitialized = 0;
         return false;
       }
@@ -5022,13 +5031,16 @@ public final class UserProtos {
                         throws java.io.IOException {
       getSerializedSize();
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeBytes(1, getQueryBytes());
+        output.writeEnum(1, status_.getNumber());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeEnum(2, type_.getNumber());
+        output.writeMessage(2, queryId_);
+      }
+      for (int i = 0; i < fragments_.size(); i++) {
+        output.writeMessage(3, fragments_.get(i));
       }
       if (((bitField0_ & 0x00000004) == 0x00000004)) {
-        output.writeBool(3, splitPlan_);
+        output.writeMessage(4, error_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -5041,17 +5053,21 @@ public final class UserProtos {
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(1, getQueryBytes());
+          .computeEnumSize(1, status_.getNumber());
       }
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(2, type_.getNumber());
+          .computeMessageSize(2, queryId_);
       }
-      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+      for (int i = 0; i < fragments_.size(); i++) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBoolSize(3, splitPlan_);
+          .computeMessageSize(3, fragments_.get(i));
       }
-      size += getUnknownFields().getSerializedSize();
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(4, error_);
+      }
+      size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
@@ -5063,53 +5079,53 @@ public final class UserProtos {
       return super.writeReplace();
     }
 
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(byte[] data)
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(java.io.InputStream input)
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseFrom(input, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseDelimitedFrom(java.io.InputStream input)
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseDelimitedFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input, extensionRegistry);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments parseFrom(
+    public static org.apache.drill.exec.proto.UserProtos.QueryPlanFragments parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
@@ -5118,7 +5134,7 @@ public final class UserProtos {
 
     public static Builder newBuilder() { return Builder.create(); }
     public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments prototype) {
+    public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.QueryPlanFragments prototype) {
       return newBuilder().mergeFrom(prototype);
     }
     public Builder toBuilder() { return newBuilder(this); }
@@ -5130,24 +5146,24 @@ public final class UserProtos {
       return builder;
     }
     /**
-     * Protobuf type {@code exec.user.GetQueryPlanFragments}
+     * Protobuf type {@code exec.user.QueryPlanFragments}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessage.Builder<Builder>
-       implements org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragmentsOrBuilder {
+       implements org.apache.drill.exec.proto.UserProtos.QueryPlanFragmentsOrBuilder {
       public static final com.google.protobuf.Descriptors.Descriptor
           getDescriptor() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_QueryPlanFragments_descriptor;
       }
 
       protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_fieldAccessorTable
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_QueryPlanFragments_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
-                org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.Builder.class);
+                org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.class, org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.Builder.class);
       }
 
-      // Construct using org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.newBuilder()
+      // Construct using org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.newBuilder()
       private Builder() {
         maybeForceBuilderInitialization();
       }
@@ -5159,6 +5175,9 @@ public final class UserProtos {
       }
       private void maybeForceBuilderInitialization() {
         if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+          getQueryIdFieldBuilder();
+          getFragmentsFieldBuilder();
+          getErrorFieldBuilder();
         }
       }
       private static Builder create() {
@@ -5167,12 +5186,26 @@ public final class UserProtos {
 
       public Builder clear() {
         super.clear();
-        query_ = "";
+        status_ = org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState.STARTING;
         bitField0_ = (bitField0_ & ~0x00000001);
-        type_ = org.apache.drill.exec.proto.UserBitShared.QueryType.SQL;
+        if (queryIdBuilder_ == null) {
+          queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
+        } else {
+          queryIdBuilder_.clear();
+        }
         bitField0_ = (bitField0_ & ~0x00000002);
-        splitPlan_ = false;
-        bitField0_ = (bitField0_ & ~0x00000004);
+        if (fragmentsBuilder_ == null) {
+          fragments_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000004);
+        } else {
+          fragmentsBuilder_.clear();
+        }
+        if (errorBuilder_ == null) {
+          error_ = org.apache.drill.exec.proto.UserBitShared.DrillPBError.getDefaultInstance();
+        } else {
+          errorBuilder_.clear();
+        }
+        bitField0_ = (bitField0_ & ~0x00000008);
         return this;
       }
 
@@ -5182,70 +5215,111 @@ public final class UserProtos {
 
       public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
-        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_GetQueryPlanFragments_descriptor;
+        return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_QueryPlanFragments_descriptor;
       }
 
-      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments getDefaultInstanceForType() {
-        return org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.getDefaultInstance();
+      public org.apache.drill.exec.proto.UserProtos.QueryPlanFragments getDefaultInstanceForType() {
+        return org.apache.drill.exec.proto.UserProtos.QueryPlanFragments.getDefaultInstance();
       }
 
-      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments build() {
-        org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments result = buildPartial();
+      public org.apache.drill.exec.proto.UserProtos.QueryPlanFragments build() {
+        org.apache.drill.exec.proto.UserProtos.QueryPlanFragments result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
         return result;
       }
 
-      public org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments buildPartial() {
-        org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments result = new org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments(this);
+      public org.apache.drill.exec.proto.UserProtos.QueryPlanFragments buildPartial() {
+        org.apache.drill.exec.proto.UserProtos.QueryPlanFragments result = new org.apache.drill.exec.proto.UserProtos.QueryPlanFragments(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
           to_bitField0_ |= 0x00000001;
         }
-        result.query_ = query_;
+        result.status_ = status_;
         if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
           to_bitField0_ |= 0x00000002;
         }
-        result.type_ = type_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+        if (queryIdBuilder_ == null) {
+          result.queryId_ = queryId_;
+        } else {
+          result.queryId_ = queryIdBuilder_.build();
+        }
+        if (fragmentsBuilder_ == null) {
+          if (((bitField0_ & 0x00000004) == 0x00000004)) {
+            fragments_ = java.util.Collections.unmodifiableList(fragments_);
+            bitField0_ = (bitField0_ & ~0x00000004);
+          }
+          result.fragments_ = fragments_;
+        } else {
+          result.fragments_ = fragmentsBuilder_.build();
+        }
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
           to_bitField0_ |= 0x00000004;
         }
-        result.splitPlan_ = splitPlan_;
+        if (errorBuilder_ == null) {
+          result.error_ = error_;
+        } else {
+          result.error_ = errorBuilder_.build();
+        }
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
       }
 
       public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments) {
-          return mergeFrom((org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments)other);
+        if (other instanceof org.apache.drill.exec.proto.UserProtos.QueryPlanFragments) {
+          return mergeFrom((org.apache.drill.exec.proto.UserProtos.QueryPlanFragments)other);
         } else {
           super.mergeFrom(other);
           return this;
         }
       }
 
-      public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments other) {
-        if (other == org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments.getDefaultInstance()) return this;
-        if (other.hasQuery()) {
-          bitField0_ |= 0x00000001;
-          query_ = other.query_;
-

<TRUNCATED>