From 78739889164c8df84fee249310f6d72d1199ea04 Mon Sep 17 00:00:00 2001 From: Paul Rogers Date: Mon, 15 May 2017 15:00:21 -0700 Subject: DRILL-5512: Standardize error handling in ScanBatch Standardizes error handling to throw a UserException. Prior code threw various exceptions, called the fail() method, or returned a variety of status codes. closes #838 --- .../java/org/apache/drill/common/types/TypeProtos.java | 4 ++-- .../java/org/apache/drill/exec/proto/UserBitShared.java | 16 ++++++++++++---- protocol/src/main/protobuf/Types.proto | 7 ++----- protocol/src/main/protobuf/UserBitShared.proto | 8 ++++++-- 4 files changed, 22 insertions(+), 13 deletions(-) (limited to 'protocol') diff --git a/protocol/src/main/java/org/apache/drill/common/types/TypeProtos.java b/protocol/src/main/java/org/apache/drill/common/types/TypeProtos.java index ff5698a91..1fa4848de 100644 --- a/protocol/src/main/java/org/apache/drill/common/types/TypeProtos.java +++ b/protocol/src/main/java/org/apache/drill/common/types/TypeProtos.java @@ -170,7 +170,7 @@ public final class TypeProtos { * FLOAT4 = 18; * *
-     *  4 byte ieee 754 
+     *  4 byte ieee 754
      * 
*/ FLOAT4(17, 18), @@ -463,7 +463,7 @@ public final class TypeProtos { * FLOAT4 = 18; * *
-     *  4 byte ieee 754 
+     *  4 byte ieee 754
      * 
*/ public static final int FLOAT4_VALUE = 18; 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 d28a13d6d..e4261df95 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 @@ -2178,6 +2178,10 @@ public final class UserBitShared { * *
        * equivalent to SQLNonTransientException.
+       * - unexpected internal state
+       * - uncategorized operation
+       * general user action is to contact the Drill team for
+       * assistance
        * 
*/ SYSTEM(8, 8), @@ -2186,8 +2190,8 @@ public final class UserBitShared { * *
        * equivalent to SQLFeatureNotSupportedException
-       * - type change
-       * - schema change
+       * - unimplemented feature, option, or execution path
+       * - schema change in operator that does not support it
        * 
*/ UNSUPPORTED_OPERATION(9, 9), @@ -2286,6 +2290,10 @@ public final class UserBitShared { * *
        * equivalent to SQLNonTransientException.
+       * - unexpected internal state
+       * - uncategorized operation
+       * general user action is to contact the Drill team for
+       * assistance
        * 
*/ public static final int SYSTEM_VALUE = 8; @@ -2294,8 +2302,8 @@ public final class UserBitShared { * *
        * equivalent to SQLFeatureNotSupportedException
-       * - type change
-       * - schema change
+       * - unimplemented feature, option, or execution path
+       * - schema change in operator that does not support it
        * 
*/ public static final int UNSUPPORTED_OPERATION_VALUE = 9; diff --git a/protocol/src/main/protobuf/Types.proto b/protocol/src/main/protobuf/Types.proto index 71fa4acd9..b2b29f085 100644 --- a/protocol/src/main/protobuf/Types.proto +++ b/protocol/src/main/protobuf/Types.proto @@ -24,7 +24,7 @@ option optimize_for = SPEED; enum MinorType { LATE = 0; // late binding type MAP = 1; // an empty map column. Useful for conceptual setup. Children listed within here - + TINYINT = 3; // single byte signed integer SMALLINT = 4; // two byte signed integer INT = 5; // four byte signed integer @@ -40,7 +40,7 @@ enum MinorType { TIMESTAMPTZ = 15; // unix epoch time in millis TIMESTAMP = 16; // TBD INTERVAL = 17; // TBD - FLOAT4 = 18; // 4 byte ieee 754 + FLOAT4 = 18; // 4 byte ieee 754 FLOAT8 = 19; // 8 byte ieee 754 BIT = 20; // single bit value (boolean) FIXEDCHAR = 21; // utf8 fixed length string, padded with spaces @@ -77,11 +77,8 @@ message MajorType { repeated MinorType sub_type = 7; // used by Union type } - - enum DataMode { OPTIONAL = 0; // nullable REQUIRED = 1; // non-nullable REPEATED = 2; // single, repeated-field } - diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto index b09171146..65f9698c1 100644 --- a/protocol/src/main/protobuf/UserBitShared.proto +++ b/protocol/src/main/protobuf/UserBitShared.proto @@ -74,11 +74,15 @@ message DrillPBError{ */ RESOURCE = 7; /* equivalent to SQLNonTransientException. + * - unexpected internal state + * - uncategorized operation + * general user action is to contact the Drill team for + * assistance */ SYSTEM = 8; /* equivalent to SQLFeatureNotSupportedException - * - type change - * - schema change + * - unimplemented feature, option, or execution path + * - schema change in operator that does not support it */ UNSUPPORTED_OPERATION = 9; /* SQL validation exception -- cgit v1.2.3