You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by am...@apache.org on 2018/01/24 18:35:21 UTC

[07/11] drill git commit: DRILL-6049: Misc. hygiene and code cleanup changes

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java
index 4a501b8..9a7e847 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/MapVector.java
@@ -49,7 +49,6 @@ import com.google.common.collect.Ordering;
 import com.google.common.primitives.Ints;
 
 public class MapVector extends AbstractMapVector {
-  //private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MapVector.class);
 
   public final static MajorType TYPE = Types.required(MinorType.MAP);
 
@@ -58,11 +57,11 @@ public class MapVector extends AbstractMapVector {
   private final Mutator mutator = new Mutator();
   private int valueCount;
 
-  public MapVector(String path, BufferAllocator allocator, CallBack callBack){
+  public MapVector(String path, BufferAllocator allocator, CallBack callBack) {
     this(MaterializedField.create(path, TYPE), allocator, callBack);
   }
 
-  public MapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack){
+  public MapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack) {
     super(field, allocator, callBack);
   }
 
@@ -73,14 +72,14 @@ public class MapVector extends AbstractMapVector {
   transient private MapSingleCopier ephPair2;
 
   public void copyFromSafe(int fromIndex, int thisIndex, MapVector from) {
-    if(ephPair == null || ephPair.from != from) {
+    if (ephPair == null || ephPair.from != from) {
       ephPair = (MapTransferPair) from.makeTransferPair(this);
     }
     ephPair.copyValueSafe(fromIndex, thisIndex);
   }
 
   public void copyFromSafe(int fromSubIndex, int thisIndex, RepeatedMapVector from) {
-    if(ephPair2 == null || ephPair2.from != from) {
+    if (ephPair2 == null || ephPair2.from != from) {
       ephPair2 = from.makeSingularCopier(this);
     }
     ephPair2.copySafe(fromSubIndex, thisIndex);
@@ -143,9 +142,6 @@ public class MapVector extends AbstractMapVector {
 
   @Override
   public DrillBuf[] getBuffers(boolean clear) {
-    //int expectedSize = getBufferSize();
-    //int actualSize   = super.getBufferSize();
-    //Preconditions.checkArgument(expectedSize == actualSize);
     return super.getBuffers(clear);
   }
 
@@ -294,9 +290,9 @@ public class MapVector extends AbstractMapVector {
 
   @Override
   public SerializedField getMetadata() {
-    SerializedField.Builder b = getField() //
-        .getAsBuilder() //
-        .setBufferLength(getBufferSize()) //
+    SerializedField.Builder b = getField()
+        .getAsBuilder()
+        .setBufferLength(getBufferSize())
         .setValueCount(valueCount);
 
 
@@ -311,13 +307,6 @@ public class MapVector extends AbstractMapVector {
     return mutator;
   }
 
-  @Override
-  public void exchange(ValueVector other) {
-    // Exchange is used for look-ahead writers, but writers manage
-    // map member vectors directly.
-    throw new UnsupportedOperationException("Exchange() not supported for maps");
-  }
-
   public class Accessor extends BaseValueVector.BaseAccessor {
 
     @Override
@@ -357,6 +346,14 @@ public class MapVector extends AbstractMapVector {
     return getChildByOrdinal(id);
   }
 
+  /**
+   * Set the value count for the map without setting the counts for the contained
+   * vectors. Use this only when the values of the contained vectors are set
+   * elsewhere in the code.
+   *
+   * @param valueCount number of items in the map
+   */
+
   public void setMapValueCount(int valueCount) {
     this.valueCount = valueCount;
   }
@@ -402,4 +399,13 @@ public class MapVector extends AbstractMapVector {
   public void toNullable(ValueVector nullableVector) {
     throw new UnsupportedOperationException();
   }
+
+  @Override
+  public void exchange(ValueVector other) {
+    super.exchange(other);
+    MapVector otherMap = (MapVector) other;
+    int temp = otherMap.valueCount;
+    otherMap.valueCount = valueCount;
+    valueCount = temp;
+  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
index 57f1a67..270f973 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedMapVector.java
@@ -64,9 +64,7 @@ public class RepeatedMapVector extends AbstractMapVector
   private final EmptyValuePopulator emptyPopulator;
 
   public RepeatedMapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack) {
-    super(field, allocator, callBack);
-    this.offsets = new UInt4Vector(BaseRepeatedValueVector.OFFSETS_FIELD, allocator);
-    this.emptyPopulator = new EmptyValuePopulator(offsets);
+    this(field, new UInt4Vector(BaseRepeatedValueVector.OFFSETS_FIELD, allocator), callBack);
   }
 
   public RepeatedMapVector(MaterializedField field, UInt4Vector offsets, CallBack callBack) {
@@ -150,7 +148,7 @@ public class RepeatedMapVector extends AbstractMapVector
     }
 
     long bufferSize = offsets.getBufferSizeFor(valueCount);
-    for (final ValueVector v : (Iterable<ValueVector>) this) {
+    for (final ValueVector v : this) {
       bufferSize += v.getBufferSizeFor(valueCount);
     }
 
@@ -424,9 +422,8 @@ public class RepeatedMapVector extends AbstractMapVector
 
   @Override
   public void exchange(ValueVector other) {
-    // Exchange is used for look-ahead writers, but writers manage
-    // map member vectors directly.
-    throw new UnsupportedOperationException("Exchange() not supported for maps");
+    super.exchange(other);
+    offsets.exchange(((RepeatedMapVector) other).offsets);
   }
 
   @Override
@@ -459,13 +456,13 @@ public class RepeatedMapVector extends AbstractMapVector
     assert bufOffset == buffer.writerIndex();
   }
 
-
   @Override
   public SerializedField getMetadata() {
-    SerializedField.Builder builder = getField() //
-        .getAsBuilder() //
-        .setBufferLength(getBufferSize()) //
-        // while we don't need to actually read this on load, we need it to make sure we don't skip deserialization of this vector
+    SerializedField.Builder builder = getField()
+        .getAsBuilder()
+        .setBufferLength(getBufferSize())
+        // while we don't need to actually read this on load, we need it to
+        // make sure we don't skip deserialization of this vector
         .setValueCount(accessor.getValueCount());
     builder.addChild(offsets.getMetadata());
     for (final ValueVector child : getChildren()) {

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedValueVector.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedValueVector.java b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedValueVector.java
index 0fba292..4bcfba6 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedValueVector.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/RepeatedValueVector.java
@@ -35,9 +35,8 @@ public interface RepeatedValueVector extends ValueVector, ContainerVectorLike {
 
   /**
    * Returns the underlying offset vector or null if none exists.
-   *
-   * TODO(DRILL-2995): eliminate exposing low-level interfaces.
    */
+
   UInt4Vector getOffsetVector();
 
   /**

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/StateTool.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/StateTool.java b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/StateTool.java
index f5ed3a0..9a736d3 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/StateTool.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/StateTool.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -22,13 +22,15 @@ import java.util.Arrays;
 public class StateTool {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StateTool.class);
 
+  @SuppressWarnings("unchecked")
   public static <T extends Enum<?>> void check(T currentState, T... expectedStates) {
     for (T s : expectedStates) {
       if (s == currentState) {
         return;
       }
     }
-    throw new IllegalArgumentException(String.format("Expected to be in one of these states %s but was actuall in state %s", Arrays.toString(expectedStates), currentState));
+    throw new IllegalArgumentException(
+        String.format("Expected to be in one of these states %s but was actually in state %s",
+            Arrays.toString(expectedStates), currentState));
   }
-
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/PromotableWriter.java
----------------------------------------------------------------------
diff --git a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/PromotableWriter.java b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/PromotableWriter.java
index 10ac551..28e90b9 100644
--- a/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/PromotableWriter.java
+++ b/exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/PromotableWriter.java
@@ -120,6 +120,7 @@ public class PromotableWriter extends AbstractPromotableFieldWriter {
     }
   }
 
+  @Override
   protected FieldWriter getWriter(MinorType type) {
     if (state == State.UNION) {
       return writer;
@@ -144,6 +145,7 @@ public class PromotableWriter extends AbstractPromotableFieldWriter {
     return writer.isEmptyMap();
   }
 
+  @Override
   protected FieldWriter getWriter() {
     return getWriter(type);
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/logical/src/main/java/org/apache/drill/common/expression/LogicalExpressionBase.java
----------------------------------------------------------------------
diff --git a/logical/src/main/java/org/apache/drill/common/expression/LogicalExpressionBase.java b/logical/src/main/java/org/apache/drill/common/expression/LogicalExpressionBase.java
index 7dfe4a2..22f2b09 100644
--- a/logical/src/main/java/org/apache/drill/common/expression/LogicalExpressionBase.java
+++ b/logical/src/main/java/org/apache/drill/common/expression/LogicalExpressionBase.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -17,19 +17,12 @@
  */
 package org.apache.drill.common.expression;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import org.apache.drill.common.config.DrillConfig;
 import org.apache.drill.common.types.TypeProtos.MajorType;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
 
 @JsonPropertyOrder({ "type" })
 public abstract class LogicalExpressionBase implements LogicalExpression {
@@ -62,11 +55,13 @@ public abstract class LogicalExpressionBase implements LogicalExpression {
     return this.getClass().getSimpleName();
   }
 
+  @Override
   @JsonIgnore
   public int getSelfCost() {
     return 0;
   }
 
+  @Override
   @JsonIgnore
   public int getCumulativeCost()  {
     int cost = this.getSelfCost();

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/logical/src/main/java/org/apache/drill/common/expression/PathSegment.java
----------------------------------------------------------------------
diff --git a/logical/src/main/java/org/apache/drill/common/expression/PathSegment.java b/logical/src/main/java/org/apache/drill/common/expression/PathSegment.java
index 16bb255..f198620 100644
--- a/logical/src/main/java/org/apache/drill/common/expression/PathSegment.java
+++ b/logical/src/main/java/org/apache/drill/common/expression/PathSegment.java
@@ -28,6 +28,7 @@ public abstract class PathSegment {
   }
 
   public abstract PathSegment cloneWithNewChild(PathSegment segment);
+
   @Override
   public abstract PathSegment clone();
 
@@ -123,7 +124,6 @@ public abstract class PathSegment {
     }
   }
 
-
   public static final class NameSegment extends PathSegment {
     private final String path;
 
@@ -137,24 +137,16 @@ public abstract class PathSegment {
       this.path = n.toString();
     }
 
-    public String getPath() {
-      return path;
-    }
+    public String getPath() { return path; }
 
     @Override
-    public boolean isArray() {
-      return false;
-    }
+    public boolean isArray() { return false; }
 
     @Override
-    public boolean isNamed() {
-      return true;
-    }
+    public boolean isNamed() { return true; }
 
     @Override
-    public NameSegment getNameSegment() {
-      return this;
-    }
+    public NameSegment getNameSegment() { return this; }
 
     @Override
     public String toString() {
@@ -183,6 +175,11 @@ public abstract class PathSegment {
       return path.equalsIgnoreCase(other.path);
     }
 
+    public boolean nameEquals(String name) {
+      return path == null && name == null ||
+             path != null && path.equalsIgnoreCase(name);
+    }
+
     @Override
     public NameSegment clone() {
       NameSegment s = new NameSegment(this.path);
@@ -202,7 +199,6 @@ public abstract class PathSegment {
       }
       return s;
     }
-
   }
 
   public NameSegment getNameSegment() {
@@ -284,6 +280,7 @@ public abstract class PathSegment {
    * @param otherSeg - path segment to check if it is contained below this one.
    * @return - is this a match
    */
+
   public boolean contains(PathSegment otherSeg) {
     if (this == otherSeg) {
       return true;
@@ -309,7 +306,5 @@ public abstract class PathSegment {
     } else {
       return child.contains(otherSeg.child);
     }
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java
----------------------------------------------------------------------
diff --git a/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java b/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java
index 8854e15..95f3dbb 100644
--- a/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java
+++ b/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java
@@ -18,6 +18,7 @@
 package org.apache.drill.common.expression;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.Iterator;
 
 import org.antlr.runtime.ANTLRStringStream;
@@ -38,12 +39,29 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterators;
 
 public class SchemaPath extends LogicalExpressionBase {
 
+  public static final String WILDCARD = "*";
+  public static final SchemaPath STAR_COLUMN = getSimplePath(WILDCARD);
+
   private final NameSegment rootSegment;
 
+  public SchemaPath(SchemaPath path) {
+    super(path.getPosition());
+    this.rootSegment = path.rootSegment;
+  }
+
+  public SchemaPath(NameSegment rootSegment) {
+    super(ExpressionPosition.UNKNOWN);
+    this.rootSegment = rootSegment;
+  }
+
+  public SchemaPath(NameSegment rootSegment, ExpressionPosition pos) {
+    super(pos);
+    this.rootSegment = rootSegment;
+  }
+
   public static SchemaPath getSimplePath(String name) {
     return getCompoundPath(name);
   }
@@ -58,7 +76,7 @@ public class SchemaPath extends LogicalExpressionBase {
   }
 
   public PathSegment getLastSegment() {
-    PathSegment s= rootSegment;
+    PathSegment s = rootSegment;
     while (s.getChild() != null) {
       s = s.getChild();
     }
@@ -71,7 +89,6 @@ public class SchemaPath extends LogicalExpressionBase {
     this.rootSegment = new NameSegment(simpleName);
   }
 
-
   public NamePart getAsNamePart() {
     return getNamePart(rootSegment);
   }
@@ -157,20 +174,75 @@ public class SchemaPath extends LogicalExpressionBase {
     return true;
   }
 
+  /**
+   * Return whether this name refers to an array. The path must be an array if it
+   * ends with an array index; else it may or may not be an entire array.
+   *
+   * @return true if the path ends with an array index, false otherwise
+   */
 
-  public SchemaPath(SchemaPath path) {
-    super(path.getPosition());
-    this.rootSegment = path.rootSegment;
+  public boolean isArray() {
+    PathSegment seg = rootSegment;
+    while (seg != null) {
+      if (seg.isArray()) {
+        return true;
+      }
+      seg = seg.getChild();
+    }
+    return false;
   }
 
-  public SchemaPath(NameSegment rootSegment) {
-    super(ExpressionPosition.UNKNOWN);
-    this.rootSegment = rootSegment;
+  /**
+   * Determine if this is a one-part name. In general, special columns work only
+   * if they are single-part names.
+   *
+   * @return true if this is a one-part name, false if this is a multi-part
+   * name (with either map member or array index parts.)
+   */
+
+  public boolean isLeaf() {
+    return rootSegment.isLastPath();
   }
 
-  public SchemaPath(NameSegment rootSegment, ExpressionPosition pos) {
-    super(pos);
-    this.rootSegment = rootSegment;
+  /**
+   * Return if this column is the special wildcard ("*") column which means to
+   * project all table columns.
+   *
+   * @return true if the column is "*"
+   */
+
+  public boolean isWildcard() {
+    return isLeaf() && nameEquals(WILDCARD);
+  }
+
+  /**
+   * Returns if this is a simple column and the name matches the given
+   * name (ignoring case.) This does not check if the name is an entire
+   * match, only the the first (or only) part of the name matches.
+   * Also check {@link #isLeaf()} to check for a single-part name.
+   *
+   * @param name name to match
+   * @return true if this is a single-part column with that name.
+   */
+
+  public boolean nameEquals(String name) {
+    return rootSegment.nameEquals(name);
+  }
+
+  /**
+   * Return the root name: either the entire name (if one part) or
+   * the first part (if multi-part.)
+   * <ul>
+   * <li>a: returns a</li>
+   * <li>a.b: returns a</li>
+   * <li>a[10]: returns a</li>
+   * </ul>
+   *
+   * @return the root (or only) name
+   */
+
+  public String rootName() {
+    return rootSegment.getPath();
   }
 
   @Override
@@ -243,7 +315,7 @@ public class SchemaPath extends LogicalExpressionBase {
 
   @Override
   public Iterator<LogicalExpression> iterator() {
-    return Iterators.emptyIterator();
+    return Collections.emptyIterator();
   }
 
   @Override
@@ -264,6 +336,7 @@ public class SchemaPath extends LogicalExpressionBase {
     return rootSegment.getPath();
   }
 
+  @SuppressWarnings("serial")
   public static class De extends StdDeserializer<SchemaPath> {
 
     public De() {

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/logical/src/main/java/org/apache/drill/common/logical/FormatPluginConfigBase.java
----------------------------------------------------------------------
diff --git a/logical/src/main/java/org/apache/drill/common/logical/FormatPluginConfigBase.java b/logical/src/main/java/org/apache/drill/common/logical/FormatPluginConfigBase.java
index 6b9dfec..5bdb69f 100644
--- a/logical/src/main/java/org/apache/drill/common/logical/FormatPluginConfigBase.java
+++ b/logical/src/main/java/org/apache/drill/common/logical/FormatPluginConfigBase.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -25,7 +25,6 @@ import org.apache.drill.common.scanner.persistence.ScanResult;
 public abstract class FormatPluginConfigBase implements FormatPluginConfig{
   private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FormatPluginConfigBase.class);
 
-
   /**
    * scan for implementations of {@see FormatPlugin}.
    *
@@ -38,7 +37,7 @@ public abstract class FormatPluginConfigBase implements FormatPluginConfig{
       StringBuilder sb = new StringBuilder();
       sb.append("Found ");
       sb.append(pluginClasses.size());
-      sb.append("format plugin configuration classes:\n");
+      sb.append(" format plugin configuration classes:\n");
       for (Class<?> c : pluginClasses) {
         sb.append('\t');
         sb.append(c.getName());
@@ -54,5 +53,4 @@ public abstract class FormatPluginConfigBase implements FormatPluginConfig{
 
   @Override
   public abstract int hashCode();
-
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c64788c..9b2a368 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
   <properties>
     <target.gen.source.path>${project.basedir}/target/generated-sources</target.gen.source.path>
     <proto.cas.path>${project.basedir}/src/main/protobuf/</proto.cas.path>
-    <dep.junit.version>4.11</dep.junit.version>
+    <dep.junit.version>4.12</dep.junit.version>
     <dep.slf4j.version>1.7.6</dep.slf4j.version>
     <dep.guava.version>18.0</dep.guava.version>
     <forkCount>2</forkCount>

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
index edc401c..9ef1f8d 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
@@ -518,8 +518,8 @@ public final class UserBitShared {
      */
     PCAP_SUB_SCAN(37, 37),
     /**
-    * <code>KAFKA_SUB_SCAN = 38;</code>
-    */
+     * <code>KAFKA_SUB_SCAN = 38;</code>
+     */
     KAFKA_SUB_SCAN(38, 38),
     ;
 
@@ -2223,6 +2223,36 @@ public final class UserBitShared {
        * </pre>
        */
       VALIDATION(10, 10),
+      /**
+       * <code>EXECUTION_ERROR = 11;</code>
+       *
+       * <pre>
+       * Execution exception
+       *  - Internal errors not related to bad code
+       * </pre>
+       */
+      EXECUTION_ERROR(11, 11),
+      /**
+       * <code>INTERNAL_ERROR = 12;</code>
+       *
+       * <pre>
+       * Internal exception
+       *  - Failed assertions
+       *  - Other "this should not happen" cases
+       * </pre>
+       */
+      INTERNAL_ERROR(12, 12),
+      /**
+       * <code>UNSPECIFIED_ERROR = 13;</code>
+       *
+       * <pre>
+       * Unspecified exception
+       *  - Exception caught but cause is unknown
+       * Indicates code that needs revisiting to move error reporting
+       * closer to the cause.
+       * </pre>
+       */
+      UNSPECIFIED_ERROR(13, 13),
       ;
 
       /**
@@ -2335,6 +2365,36 @@ public final class UserBitShared {
        * </pre>
        */
       public static final int VALIDATION_VALUE = 10;
+      /**
+       * <code>EXECUTION_ERROR = 11;</code>
+       *
+       * <pre>
+       * Execution exception
+       *  - Internal errors not related to bad code
+       * </pre>
+       */
+      public static final int EXECUTION_ERROR_VALUE = 11;
+      /**
+       * <code>INTERNAL_ERROR = 12;</code>
+       *
+       * <pre>
+       * Internal exception
+       *  - Failed assertions
+       *  - Other "this should not happen" cases
+       * </pre>
+       */
+      public static final int INTERNAL_ERROR_VALUE = 12;
+      /**
+       * <code>UNSPECIFIED_ERROR = 13;</code>
+       *
+       * <pre>
+       * Unspecified exception
+       *  - Exception caught but cause is unknown
+       * Indicates code that needs revisiting to move error reporting
+       * closer to the cause.
+       * </pre>
+       */
+      public static final int UNSPECIFIED_ERROR_VALUE = 13;
 
 
       public final int getNumber() { return value; }
@@ -2352,6 +2412,9 @@ public final class UserBitShared {
           case 8: return SYSTEM;
           case 9: return UNSUPPORTED_OPERATION;
           case 10: return VALIDATION;
+          case 11: return EXECUTION_ERROR;
+          case 12: return INTERNAL_ERROR;
+          case 13: return UNSPECIFIED_ERROR;
           default: return null;
         }
       }
@@ -23942,127 +24005,129 @@ public final class UserBitShared {
       "s.proto\032\022Coordination.proto\032\017SchemaDef.p" +
       "roto\"$\n\017UserCredentials\022\021\n\tuser_name\030\001 \001" +
       "(\t\"\'\n\007QueryId\022\r\n\005part1\030\001 \001(\020\022\r\n\005part2\030\002 " +
-      "\001(\020\"\255\003\n\014DrillPBError\022\020\n\010error_id\030\001 \001(\t\022(" +
+      "\001(\020\"\355\003\n\014DrillPBError\022\020\n\010error_id\030\001 \001(\t\022(" +
       "\n\010endpoint\030\002 \001(\0132\026.exec.DrillbitEndpoint" +
       "\0227\n\nerror_type\030\003 \001(\0162#.exec.shared.Drill" +
       "PBError.ErrorType\022\017\n\007message\030\004 \001(\t\0220\n\tex" +
       "ception\030\005 \001(\0132\035.exec.shared.ExceptionWra" +
       "pper\0220\n\rparsing_error\030\006 \003(\0132\031.exec.share",
-      "d.ParsingError\"\262\001\n\tErrorType\022\016\n\nCONNECTI" +
+      "d.ParsingError\"\362\001\n\tErrorType\022\016\n\nCONNECTI" +
       "ON\020\000\022\r\n\tDATA_READ\020\001\022\016\n\nDATA_WRITE\020\002\022\014\n\010F" +
       "UNCTION\020\003\022\t\n\005PARSE\020\004\022\016\n\nPERMISSION\020\005\022\010\n\004" +
       "PLAN\020\006\022\014\n\010RESOURCE\020\007\022\n\n\006SYSTEM\020\010\022\031\n\025UNSU" +
-      "PPORTED_OPERATION\020\t\022\016\n\nVALIDATION\020\n\"\246\001\n\020" +
-      "ExceptionWrapper\022\027\n\017exception_class\030\001 \001(" +
-      "\t\022\017\n\007message\030\002 \001(\t\022:\n\013stack_trace\030\003 \003(\0132" +
-      "%.exec.shared.StackTraceElementWrapper\022," +
-      "\n\005cause\030\004 \001(\0132\035.exec.shared.ExceptionWra" +
-      "pper\"\205\001\n\030StackTraceElementWrapper\022\022\n\ncla",
-      "ss_name\030\001 \001(\t\022\021\n\tfile_name\030\002 \001(\t\022\023\n\013line" +
-      "_number\030\003 \001(\005\022\023\n\013method_name\030\004 \001(\t\022\030\n\020is" +
-      "_native_method\030\005 \001(\010\"\\\n\014ParsingError\022\024\n\014" +
-      "start_column\030\002 \001(\005\022\021\n\tstart_row\030\003 \001(\005\022\022\n" +
-      "\nend_column\030\004 \001(\005\022\017\n\007end_row\030\005 \001(\005\"~\n\016Re" +
-      "cordBatchDef\022\024\n\014record_count\030\001 \001(\005\022+\n\005fi" +
-      "eld\030\002 \003(\0132\034.exec.shared.SerializedField\022" +
-      ")\n!carries_two_byte_selection_vector\030\003 \001" +
-      "(\010\"\205\001\n\010NamePart\022(\n\004type\030\001 \001(\0162\032.exec.sha" +
-      "red.NamePart.Type\022\014\n\004name\030\002 \001(\t\022$\n\005child",
-      "\030\003 \001(\0132\025.exec.shared.NamePart\"\033\n\004Type\022\010\n" +
-      "\004NAME\020\000\022\t\n\005ARRAY\020\001\"\324\001\n\017SerializedField\022%" +
-      "\n\nmajor_type\030\001 \001(\0132\021.common.MajorType\022(\n" +
-      "\tname_part\030\002 \001(\0132\025.exec.shared.NamePart\022" +
-      "+\n\005child\030\003 \003(\0132\034.exec.shared.SerializedF" +
-      "ield\022\023\n\013value_count\030\004 \001(\005\022\027\n\017var_byte_le" +
-      "ngth\030\005 \001(\005\022\025\n\rbuffer_length\030\007 \001(\005\"7\n\nNod" +
-      "eStatus\022\017\n\007node_id\030\001 \001(\005\022\030\n\020memory_footp" +
-      "rint\030\002 \001(\003\"\263\002\n\013QueryResult\0228\n\013query_stat" +
-      "e\030\001 \001(\0162#.exec.shared.QueryResult.QueryS",
-      "tate\022&\n\010query_id\030\002 \001(\0132\024.exec.shared.Que" +
-      "ryId\022(\n\005error\030\003 \003(\0132\031.exec.shared.DrillP" +
-      "BError\"\227\001\n\nQueryState\022\014\n\010STARTING\020\000\022\013\n\007R" +
-      "UNNING\020\001\022\r\n\tCOMPLETED\020\002\022\014\n\010CANCELED\020\003\022\n\n" +
-      "\006FAILED\020\004\022\032\n\026CANCELLATION_REQUESTED\020\005\022\014\n" +
-      "\010ENQUEUED\020\006\022\r\n\tPREPARING\020\007\022\014\n\010PLANNING\020\010" +
-      "\"p\n\tQueryData\022&\n\010query_id\030\001 \001(\0132\024.exec.s" +
-      "hared.QueryId\022\021\n\trow_count\030\002 \001(\005\022(\n\003def\030" +
-      "\003 \001(\0132\033.exec.shared.RecordBatchDef\"\330\001\n\tQ" +
-      "ueryInfo\022\r\n\005query\030\001 \001(\t\022\r\n\005start\030\002 \001(\003\0222",
-      "\n\005state\030\003 \001(\0162#.exec.shared.QueryResult." +
-      "QueryState\022\017\n\004user\030\004 \001(\t:\001-\022\'\n\007foreman\030\005" +
-      " \001(\0132\026.exec.DrillbitEndpoint\022\024\n\014options_" +
-      "json\030\006 \001(\t\022\022\n\ntotal_cost\030\007 \001(\001\022\025\n\nqueue_" +
-      "name\030\010 \001(\t:\001-\"\242\004\n\014QueryProfile\022 \n\002id\030\001 \001" +
-      "(\0132\024.exec.shared.QueryId\022$\n\004type\030\002 \001(\0162\026" +
-      ".exec.shared.QueryType\022\r\n\005start\030\003 \001(\003\022\013\n" +
-      "\003end\030\004 \001(\003\022\r\n\005query\030\005 \001(\t\022\014\n\004plan\030\006 \001(\t\022" +
-      "\'\n\007foreman\030\007 \001(\0132\026.exec.DrillbitEndpoint" +
-      "\0222\n\005state\030\010 \001(\0162#.exec.shared.QueryResul",
-      "t.QueryState\022\027\n\017total_fragments\030\t \001(\005\022\032\n" +
-      "\022finished_fragments\030\n \001(\005\022;\n\020fragment_pr" +
-      "ofile\030\013 \003(\0132!.exec.shared.MajorFragmentP" +
-      "rofile\022\017\n\004user\030\014 \001(\t:\001-\022\r\n\005error\030\r \001(\t\022\024" +
-      "\n\014verboseError\030\016 \001(\t\022\020\n\010error_id\030\017 \001(\t\022\022" +
-      "\n\nerror_node\030\020 \001(\t\022\024\n\014options_json\030\021 \001(\t" +
-      "\022\017\n\007planEnd\030\022 \001(\003\022\024\n\014queueWaitEnd\030\023 \001(\003\022" +
-      "\022\n\ntotal_cost\030\024 \001(\001\022\025\n\nqueue_name\030\025 \001(\t:" +
-      "\001-\"t\n\024MajorFragmentProfile\022\031\n\021major_frag" +
-      "ment_id\030\001 \001(\005\022A\n\026minor_fragment_profile\030",
-      "\002 \003(\0132!.exec.shared.MinorFragmentProfile" +
-      "\"\350\002\n\024MinorFragmentProfile\022)\n\005state\030\001 \001(\016" +
-      "2\032.exec.shared.FragmentState\022(\n\005error\030\002 " +
-      "\001(\0132\031.exec.shared.DrillPBError\022\031\n\021minor_" +
-      "fragment_id\030\003 \001(\005\0226\n\020operator_profile\030\004 " +
-      "\003(\0132\034.exec.shared.OperatorProfile\022\022\n\nsta" +
-      "rt_time\030\005 \001(\003\022\020\n\010end_time\030\006 \001(\003\022\023\n\013memor" +
-      "y_used\030\007 \001(\003\022\027\n\017max_memory_used\030\010 \001(\003\022(\n" +
-      "\010endpoint\030\t \001(\0132\026.exec.DrillbitEndpoint\022" +
-      "\023\n\013last_update\030\n \001(\003\022\025\n\rlast_progress\030\013 ",
-      "\001(\003\"\377\001\n\017OperatorProfile\0221\n\rinput_profile" +
-      "\030\001 \003(\0132\032.exec.shared.StreamProfile\022\023\n\013op" +
-      "erator_id\030\003 \001(\005\022\025\n\roperator_type\030\004 \001(\005\022\023" +
-      "\n\013setup_nanos\030\005 \001(\003\022\025\n\rprocess_nanos\030\006 \001" +
-      "(\003\022#\n\033peak_local_memory_allocated\030\007 \001(\003\022" +
-      "(\n\006metric\030\010 \003(\0132\030.exec.shared.MetricValu" +
-      "e\022\022\n\nwait_nanos\030\t \001(\003\"B\n\rStreamProfile\022\017" +
-      "\n\007records\030\001 \001(\003\022\017\n\007batches\030\002 \001(\003\022\017\n\007sche" +
-      "mas\030\003 \001(\003\"J\n\013MetricValue\022\021\n\tmetric_id\030\001 " +
-      "\001(\005\022\022\n\nlong_value\030\002 \001(\003\022\024\n\014double_value\030",
-      "\003 \001(\001\")\n\010Registry\022\035\n\003jar\030\001 \003(\0132\020.exec.sh" +
-      "ared.Jar\"/\n\003Jar\022\014\n\004name\030\001 \001(\t\022\032\n\022functio" +
-      "n_signature\030\002 \003(\t\"W\n\013SaslMessage\022\021\n\tmech" +
-      "anism\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022\'\n\006status\030\003 \001(" +
-      "\0162\027.exec.shared.SaslStatus*5\n\nRpcChannel" +
-      "\022\017\n\013BIT_CONTROL\020\000\022\014\n\010BIT_DATA\020\001\022\010\n\004USER\020" +
-      "\002*V\n\tQueryType\022\007\n\003SQL\020\001\022\013\n\007LOGICAL\020\002\022\014\n\010" +
-      "PHYSICAL\020\003\022\r\n\tEXECUTION\020\004\022\026\n\022PREPARED_ST" +
-      "ATEMENT\020\005*\207\001\n\rFragmentState\022\013\n\007SENDING\020\000" +
-      "\022\027\n\023AWAITING_ALLOCATION\020\001\022\013\n\007RUNNING\020\002\022\014",
-      "\n\010FINISHED\020\003\022\r\n\tCANCELLED\020\004\022\n\n\006FAILED\020\005\022" +
-      "\032\n\026CANCELLATION_REQUESTED\020\006*\360\005\n\020CoreOper" +
-      "atorType\022\021\n\rSINGLE_SENDER\020\000\022\024\n\020BROADCAST" +
-      "_SENDER\020\001\022\n\n\006FILTER\020\002\022\022\n\016HASH_AGGREGATE\020" +
-      "\003\022\r\n\tHASH_JOIN\020\004\022\016\n\nMERGE_JOIN\020\005\022\031\n\025HASH" +
-      "_PARTITION_SENDER\020\006\022\t\n\005LIMIT\020\007\022\024\n\020MERGIN" +
-      "G_RECEIVER\020\010\022\034\n\030ORDERED_PARTITION_SENDER" +
-      "\020\t\022\013\n\007PROJECT\020\n\022\026\n\022UNORDERED_RECEIVER\020\013\022" +
-      "\020\n\014RANGE_SENDER\020\014\022\n\n\006SCREEN\020\r\022\034\n\030SELECTI" +
-      "ON_VECTOR_REMOVER\020\016\022\027\n\023STREAMING_AGGREGA",
-      "TE\020\017\022\016\n\nTOP_N_SORT\020\020\022\021\n\rEXTERNAL_SORT\020\021\022" +
-      "\t\n\005TRACE\020\022\022\t\n\005UNION\020\023\022\014\n\010OLD_SORT\020\024\022\032\n\026P" +
-      "ARQUET_ROW_GROUP_SCAN\020\025\022\021\n\rHIVE_SUB_SCAN" +
-      "\020\026\022\025\n\021SYSTEM_TABLE_SCAN\020\027\022\021\n\rMOCK_SUB_SC" +
-      "AN\020\030\022\022\n\016PARQUET_WRITER\020\031\022\023\n\017DIRECT_SUB_S" +
-      "CAN\020\032\022\017\n\013TEXT_WRITER\020\033\022\021\n\rTEXT_SUB_SCAN\020" +
-      "\034\022\021\n\rJSON_SUB_SCAN\020\035\022\030\n\024INFO_SCHEMA_SUB_" +
-      "SCAN\020\036\022\023\n\017COMPLEX_TO_JSON\020\037\022\025\n\021PRODUCER_" +
-      "CONSUMER\020 \022\022\n\016HBASE_SUB_SCAN\020!\022\n\n\006WINDOW" +
-      "\020\"\022\024\n\020NESTED_LOOP_JOIN\020#\022\021\n\rAVRO_SUB_SCA",
-      "N\020$\022\021\n\rPCAP_SUB_SCAN\020%*g\n\nSaslStatus\022\020\n\014" +
-      "SASL_UNKNOWN\020\000\022\016\n\nSASL_START\020\001\022\024\n\020SASL_I" +
-      "N_PROGRESS\020\002\022\020\n\014SASL_SUCCESS\020\003\022\017\n\013SASL_F" +
-      "AILED\020\004B.\n\033org.apache.drill.exec.protoB\r" +
-      "UserBitSharedH\001"
+      "PPORTED_OPERATION\020\t\022\016\n\nVALIDATION\020\n\022\023\n\017E" +
+      "XECUTION_ERROR\020\013\022\022\n\016INTERNAL_ERROR\020\014\022\025\n\021" +
+      "UNSPECIFIED_ERROR\020\r\"\246\001\n\020ExceptionWrapper" +
+      "\022\027\n\017exception_class\030\001 \001(\t\022\017\n\007message\030\002 \001" +
+      "(\t\022:\n\013stack_trace\030\003 \003(\0132%.exec.shared.St" +
+      "ackTraceElementWrapper\022,\n\005cause\030\004 \001(\0132\035.",
+      "exec.shared.ExceptionWrapper\"\205\001\n\030StackTr" +
+      "aceElementWrapper\022\022\n\nclass_name\030\001 \001(\t\022\021\n" +
+      "\tfile_name\030\002 \001(\t\022\023\n\013line_number\030\003 \001(\005\022\023\n" +
+      "\013method_name\030\004 \001(\t\022\030\n\020is_native_method\030\005" +
+      " \001(\010\"\\\n\014ParsingError\022\024\n\014start_column\030\002 \001" +
+      "(\005\022\021\n\tstart_row\030\003 \001(\005\022\022\n\nend_column\030\004 \001(" +
+      "\005\022\017\n\007end_row\030\005 \001(\005\"~\n\016RecordBatchDef\022\024\n\014" +
+      "record_count\030\001 \001(\005\022+\n\005field\030\002 \003(\0132\034.exec" +
+      ".shared.SerializedField\022)\n!carries_two_b" +
+      "yte_selection_vector\030\003 \001(\010\"\205\001\n\010NamePart\022",
+      "(\n\004type\030\001 \001(\0162\032.exec.shared.NamePart.Typ" +
+      "e\022\014\n\004name\030\002 \001(\t\022$\n\005child\030\003 \001(\0132\025.exec.sh" +
+      "ared.NamePart\"\033\n\004Type\022\010\n\004NAME\020\000\022\t\n\005ARRAY" +
+      "\020\001\"\324\001\n\017SerializedField\022%\n\nmajor_type\030\001 \001" +
+      "(\0132\021.common.MajorType\022(\n\tname_part\030\002 \001(\013" +
+      "2\025.exec.shared.NamePart\022+\n\005child\030\003 \003(\0132\034" +
+      ".exec.shared.SerializedField\022\023\n\013value_co" +
+      "unt\030\004 \001(\005\022\027\n\017var_byte_length\030\005 \001(\005\022\025\n\rbu" +
+      "ffer_length\030\007 \001(\005\"7\n\nNodeStatus\022\017\n\007node_" +
+      "id\030\001 \001(\005\022\030\n\020memory_footprint\030\002 \001(\003\"\263\002\n\013Q",
+      "ueryResult\0228\n\013query_state\030\001 \001(\0162#.exec.s" +
+      "hared.QueryResult.QueryState\022&\n\010query_id" +
+      "\030\002 \001(\0132\024.exec.shared.QueryId\022(\n\005error\030\003 " +
+      "\003(\0132\031.exec.shared.DrillPBError\"\227\001\n\nQuery" +
+      "State\022\014\n\010STARTING\020\000\022\013\n\007RUNNING\020\001\022\r\n\tCOMP" +
+      "LETED\020\002\022\014\n\010CANCELED\020\003\022\n\n\006FAILED\020\004\022\032\n\026CAN" +
+      "CELLATION_REQUESTED\020\005\022\014\n\010ENQUEUED\020\006\022\r\n\tP" +
+      "REPARING\020\007\022\014\n\010PLANNING\020\010\"p\n\tQueryData\022&\n" +
+      "\010query_id\030\001 \001(\0132\024.exec.shared.QueryId\022\021\n" +
+      "\trow_count\030\002 \001(\005\022(\n\003def\030\003 \001(\0132\033.exec.sha",
+      "red.RecordBatchDef\"\330\001\n\tQueryInfo\022\r\n\005quer" +
+      "y\030\001 \001(\t\022\r\n\005start\030\002 \001(\003\0222\n\005state\030\003 \001(\0162#." +
+      "exec.shared.QueryResult.QueryState\022\017\n\004us" +
+      "er\030\004 \001(\t:\001-\022\'\n\007foreman\030\005 \001(\0132\026.exec.Dril" +
+      "lbitEndpoint\022\024\n\014options_json\030\006 \001(\t\022\022\n\nto" +
+      "tal_cost\030\007 \001(\001\022\025\n\nqueue_name\030\010 \001(\t:\001-\"\242\004" +
+      "\n\014QueryProfile\022 \n\002id\030\001 \001(\0132\024.exec.shared" +
+      ".QueryId\022$\n\004type\030\002 \001(\0162\026.exec.shared.Que" +
+      "ryType\022\r\n\005start\030\003 \001(\003\022\013\n\003end\030\004 \001(\003\022\r\n\005qu" +
+      "ery\030\005 \001(\t\022\014\n\004plan\030\006 \001(\t\022\'\n\007foreman\030\007 \001(\013",
+      "2\026.exec.DrillbitEndpoint\0222\n\005state\030\010 \001(\0162" +
+      "#.exec.shared.QueryResult.QueryState\022\027\n\017" +
+      "total_fragments\030\t \001(\005\022\032\n\022finished_fragme" +
+      "nts\030\n \001(\005\022;\n\020fragment_profile\030\013 \003(\0132!.ex" +
+      "ec.shared.MajorFragmentProfile\022\017\n\004user\030\014" +
+      " \001(\t:\001-\022\r\n\005error\030\r \001(\t\022\024\n\014verboseError\030\016" +
+      " \001(\t\022\020\n\010error_id\030\017 \001(\t\022\022\n\nerror_node\030\020 \001" +
+      "(\t\022\024\n\014options_json\030\021 \001(\t\022\017\n\007planEnd\030\022 \001(" +
+      "\003\022\024\n\014queueWaitEnd\030\023 \001(\003\022\022\n\ntotal_cost\030\024 " +
+      "\001(\001\022\025\n\nqueue_name\030\025 \001(\t:\001-\"t\n\024MajorFragm",
+      "entProfile\022\031\n\021major_fragment_id\030\001 \001(\005\022A\n" +
+      "\026minor_fragment_profile\030\002 \003(\0132!.exec.sha" +
+      "red.MinorFragmentProfile\"\350\002\n\024MinorFragme" +
+      "ntProfile\022)\n\005state\030\001 \001(\0162\032.exec.shared.F" +
+      "ragmentState\022(\n\005error\030\002 \001(\0132\031.exec.share" +
+      "d.DrillPBError\022\031\n\021minor_fragment_id\030\003 \001(" +
+      "\005\0226\n\020operator_profile\030\004 \003(\0132\034.exec.share" +
+      "d.OperatorProfile\022\022\n\nstart_time\030\005 \001(\003\022\020\n" +
+      "\010end_time\030\006 \001(\003\022\023\n\013memory_used\030\007 \001(\003\022\027\n\017" +
+      "max_memory_used\030\010 \001(\003\022(\n\010endpoint\030\t \001(\0132",
+      "\026.exec.DrillbitEndpoint\022\023\n\013last_update\030\n" +
+      " \001(\003\022\025\n\rlast_progress\030\013 \001(\003\"\377\001\n\017Operator" +
+      "Profile\0221\n\rinput_profile\030\001 \003(\0132\032.exec.sh" +
+      "ared.StreamProfile\022\023\n\013operator_id\030\003 \001(\005\022" +
+      "\025\n\roperator_type\030\004 \001(\005\022\023\n\013setup_nanos\030\005 " +
+      "\001(\003\022\025\n\rprocess_nanos\030\006 \001(\003\022#\n\033peak_local" +
+      "_memory_allocated\030\007 \001(\003\022(\n\006metric\030\010 \003(\0132" +
+      "\030.exec.shared.MetricValue\022\022\n\nwait_nanos\030" +
+      "\t \001(\003\"B\n\rStreamProfile\022\017\n\007records\030\001 \001(\003\022" +
+      "\017\n\007batches\030\002 \001(\003\022\017\n\007schemas\030\003 \001(\003\"J\n\013Met",
+      "ricValue\022\021\n\tmetric_id\030\001 \001(\005\022\022\n\nlong_valu" +
+      "e\030\002 \001(\003\022\024\n\014double_value\030\003 \001(\001\")\n\010Registr" +
+      "y\022\035\n\003jar\030\001 \003(\0132\020.exec.shared.Jar\"/\n\003Jar\022" +
+      "\014\n\004name\030\001 \001(\t\022\032\n\022function_signature\030\002 \003(" +
+      "\t\"W\n\013SaslMessage\022\021\n\tmechanism\030\001 \001(\t\022\014\n\004d" +
+      "ata\030\002 \001(\014\022\'\n\006status\030\003 \001(\0162\027.exec.shared." +
+      "SaslStatus*5\n\nRpcChannel\022\017\n\013BIT_CONTROL\020" +
+      "\000\022\014\n\010BIT_DATA\020\001\022\010\n\004USER\020\002*V\n\tQueryType\022\007" +
+      "\n\003SQL\020\001\022\013\n\007LOGICAL\020\002\022\014\n\010PHYSICAL\020\003\022\r\n\tEX" +
+      "ECUTION\020\004\022\026\n\022PREPARED_STATEMENT\020\005*\207\001\n\rFr",
+      "agmentState\022\013\n\007SENDING\020\000\022\027\n\023AWAITING_ALL" +
+      "OCATION\020\001\022\013\n\007RUNNING\020\002\022\014\n\010FINISHED\020\003\022\r\n\t" +
+      "CANCELLED\020\004\022\n\n\006FAILED\020\005\022\032\n\026CANCELLATION_" +
+      "REQUESTED\020\006*\204\006\n\020CoreOperatorType\022\021\n\rSING" +
+      "LE_SENDER\020\000\022\024\n\020BROADCAST_SENDER\020\001\022\n\n\006FIL" +
+      "TER\020\002\022\022\n\016HASH_AGGREGATE\020\003\022\r\n\tHASH_JOIN\020\004" +
+      "\022\016\n\nMERGE_JOIN\020\005\022\031\n\025HASH_PARTITION_SENDE" +
+      "R\020\006\022\t\n\005LIMIT\020\007\022\024\n\020MERGING_RECEIVER\020\010\022\034\n\030" +
+      "ORDERED_PARTITION_SENDER\020\t\022\013\n\007PROJECT\020\n\022" +
+      "\026\n\022UNORDERED_RECEIVER\020\013\022\020\n\014RANGE_SENDER\020",
+      "\014\022\n\n\006SCREEN\020\r\022\034\n\030SELECTION_VECTOR_REMOVE" +
+      "R\020\016\022\027\n\023STREAMING_AGGREGATE\020\017\022\016\n\nTOP_N_SO" +
+      "RT\020\020\022\021\n\rEXTERNAL_SORT\020\021\022\t\n\005TRACE\020\022\022\t\n\005UN" +
+      "ION\020\023\022\014\n\010OLD_SORT\020\024\022\032\n\026PARQUET_ROW_GROUP" +
+      "_SCAN\020\025\022\021\n\rHIVE_SUB_SCAN\020\026\022\025\n\021SYSTEM_TAB" +
+      "LE_SCAN\020\027\022\021\n\rMOCK_SUB_SCAN\020\030\022\022\n\016PARQUET_" +
+      "WRITER\020\031\022\023\n\017DIRECT_SUB_SCAN\020\032\022\017\n\013TEXT_WR" +
+      "ITER\020\033\022\021\n\rTEXT_SUB_SCAN\020\034\022\021\n\rJSON_SUB_SC" +
+      "AN\020\035\022\030\n\024INFO_SCHEMA_SUB_SCAN\020\036\022\023\n\017COMPLE" +
+      "X_TO_JSON\020\037\022\025\n\021PRODUCER_CONSUMER\020 \022\022\n\016HB",
+      "ASE_SUB_SCAN\020!\022\n\n\006WINDOW\020\"\022\024\n\020NESTED_LOO" +
+      "P_JOIN\020#\022\021\n\rAVRO_SUB_SCAN\020$\022\021\n\rPCAP_SUB_" +
+      "SCAN\020%\022\022\n\016KAFKA_SUB_SCAN\020&*g\n\nSaslStatus" +
+      "\022\020\n\014SASL_UNKNOWN\020\000\022\016\n\nSASL_START\020\001\022\024\n\020SA" +
+      "SL_IN_PROGRESS\020\002\022\020\n\014SASL_SUCCESS\020\003\022\017\n\013SA" +
+      "SL_FAILED\020\004B.\n\033org.apache.drill.exec.pro" +
+      "toB\rUserBitSharedH\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/protocol/src/main/java/org/apache/drill/exec/proto/beans/DrillPBError.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/DrillPBError.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/DrillPBError.java
index ee237d9..1a105f2 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/DrillPBError.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/DrillPBError.java
@@ -47,7 +47,10 @@ public final class DrillPBError implements Externalizable, Message<DrillPBError>
         RESOURCE(7),
         SYSTEM(8),
         UNSUPPORTED_OPERATION(9),
-        VALIDATION(10);
+        VALIDATION(10),
+        EXECUTION_ERROR(11),
+        INTERNAL_ERROR(12),
+        UNSPECIFIED_ERROR(13);
         
         public final int number;
         
@@ -76,6 +79,9 @@ public final class DrillPBError implements Externalizable, Message<DrillPBError>
                 case 8: return SYSTEM;
                 case 9: return UNSUPPORTED_OPERATION;
                 case 10: return VALIDATION;
+                case 11: return EXECUTION_ERROR;
+                case 12: return INTERNAL_ERROR;
+                case 13: return UNSPECIFIED_ERROR;
                 default: return null;
             }
         }

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/protocol/src/main/protobuf/GeneralRPC.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/GeneralRPC.proto b/protocol/src/main/protobuf/GeneralRPC.proto
index 26ab821..bed2ad3 100644
--- a/protocol/src/main/protobuf/GeneralRPC.proto
+++ b/protocol/src/main/protobuf/GeneralRPC.proto
@@ -19,7 +19,7 @@ enum RpcMode {
 }
 
 message RpcHeader{
-	optional RpcMode mode = 1; 
+	optional RpcMode mode = 1;
 	optional int32 coordination_id = 2; // reusable coordination identifier.  Sender defines.  Server returns on return.  Irrelevant for purely single direction rpc.
 	optional int32 rpc_type = 3; // a rpc mode specific rpc type.
 }
@@ -29,7 +29,3 @@ message CompleteRpcMessage {
     optional bytes protobuf_body = 2; // required
     optional bytes raw_body = 3; // optional
 }
-
-
-
-

http://git-wip-us.apache.org/repos/asf/drill/blob/e791ed62/protocol/src/main/protobuf/UserBitShared.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto
index 205611b..dc8bdb6 100644
--- a/protocol/src/main/protobuf/UserBitShared.proto
+++ b/protocol/src/main/protobuf/UserBitShared.proto
@@ -90,6 +90,21 @@ message DrillPBError{
      * - invalid entries in SQL tree
      */
     VALIDATION = 10;
+    /* Execution exception
+     *  - Internal errors not related to bad code
+     */
+    EXECUTION_ERROR = 11;
+    /* Internal exception
+     *  - Failed assertions
+     *  - Other "this should not happen" cases
+     */
+    INTERNAL_ERROR = 12;
+    /* Unspecified exception
+     *  - Exception caught but cause is unknown
+     * Indicates code that needs revisiting to move error reporting
+     * closer to the cause.
+     */
+    UNSPECIFIED_ERROR = 13;
   }
   optional string error_id = 1; // for debug tracing purposes
   optional DrillbitEndpoint endpoint = 2;
@@ -114,7 +129,6 @@ message StackTraceElementWrapper {
     optional bool is_native_method = 5;
 }
 
-
 message ParsingError{
   optional int32 start_column = 2;
   optional int32 start_row = 3;