drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [1/2] drill git commit: DRILL-2675 (PART-2): Implement a subset of User Exceptions to improve how errors are reported to the user
Date Fri, 17 Apr 2015 05:08:48 GMT
Repository: drill
Updated Branches:
  refs/heads/master 64e3ec52b -> 238399de5


http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/TestBugFixes.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestBugFixes.java b/exec/java-exec/src/test/java/org/apache/drill/TestBugFixes.java
index 12b1787..c627ff2 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestBugFixes.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestBugFixes.java
@@ -17,7 +17,7 @@
  */
 package org.apache.drill;
 
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -73,13 +73,13 @@ public class TestBugFixes extends BaseTestQuery {
   }
 
 
-  @Test (expected = DrillUserException.class)
+  @Test (expected = UserException.class)
   // Should be "Failure while parsing sql. Node [rel#26:Subset#6.LOGICAL.ANY([]).[]] could
not be implemented;".
   // Drill will hit CanNotPlan, until we add code fix to transform the local LHS filter in
left outer join properly.
   public void testDRILL1337_LocalLeftFilterLeftOutJoin() throws Exception {
     try {
       test("select count(*) from cp.`tpch/nation.parquet` n left outer join cp.`tpch/region.parquet`
r on n.n_regionkey = r.r_regionkey and n.n_nationkey > 10;");
-    } catch (DrillUserException e) {
+    } catch (UserException e) {
       logger.info("***** Test resulted in expected failure: " + e.getMessage());
       throw e;
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
b/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
index 111c3c1..e049943 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 package org.apache.drill;
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.exec.work.foreman.SqlUnsupportedException;
 import org.apache.drill.exec.work.foreman.UnsupportedDataTypeException;
 import org.apache.drill.exec.work.foreman.UnsupportedFunctionException;
@@ -26,27 +26,27 @@ import org.junit.Test;
 public class TestDisabledFunctionality extends BaseTestQuery{
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestExampleQueries.class);
 
-  @Test(expected = DrillUserException.class)  // see DRILL-2054
+  @Test(expected = UserException.class)  // see DRILL-2054
   public void testBooleanORExpression() throws Exception {
         test("select (1 = 1) || (1 > 0) from cp.`tpch/nation.parquet` ");
     }
 
-  @Test(expected = DrillUserException.class)  // see DRILL-2054
+  @Test(expected = UserException.class)  // see DRILL-2054
   public void testBooleanORSelectClause() throws Exception {
     test("select true || true from cp.`tpch/nation.parquet` ");
   }
 
-  @Test(expected = DrillUserException.class)  // see DRILL-2054
+  @Test(expected = UserException.class)  // see DRILL-2054
   public void testBooleanORWhereClause() throws Exception {
     test("select * from cp.`tpch/nation.parquet` where (true || true) ");
   }
 
-  @Test(expected = DrillUserException.class)  // see DRILL-2054
+  @Test(expected = UserException.class)  // see DRILL-2054
   public void testBooleanAND() throws Exception {
     test("select true && true from cp.`tpch/nation.parquet` ");
   }
 
-  private static void throwAsUnsupportedException(DrillUserException ex) throws Exception
{
+  private static void throwAsUnsupportedException(UserException ex) throws Exception {
     SqlUnsupportedException.errorClassNameToException(ex.getOrCreatePBError(false).getException().getExceptionClass());
     throw ex;
   }
@@ -58,7 +58,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
            "where n_nationkey = " +
            "(select r_regionkey from cp.`tpch/region.parquet` " +
            "where r_regionkey = 1)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -70,7 +70,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
            "where n_nationkey = " +
            "(select r_regionkey from cp.`tpch/region.parquet` " +
            "where r_regionkey = 1)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -79,7 +79,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledUnion() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) UNION (select r_name as
name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -88,7 +88,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledUnionDistinct() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) UNION DISTINCT (select
r_name as name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -97,7 +97,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledIntersect() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) INTERSECT (select r_name
as name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -106,7 +106,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledIntersectALL() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) INTERSECT ALL (select r_name
as name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -115,7 +115,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledExceptALL() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) EXCEPT ALL (select r_name
as name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -124,7 +124,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledExcept() throws Exception {
     try {
       test("(select n_name as name from cp.`tpch/nation.parquet`) EXCEPT (select r_name as
name from cp.`tpch/region.parquet`)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -133,7 +133,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledNaturalJoin() throws Exception {
     try {
       test("select * from cp.`tpch/nation.parquet` NATURAL JOIN cp.`tpch/region.parquet`");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -142,7 +142,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledCrossJoin() throws Exception {
     try {
       test("select * from cp.`tpch/nation.parquet` CROSS JOIN cp.`tpch/region.parquet`");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -151,7 +151,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledCastTINYINT() throws Exception {
     try {
       test("select cast(n_name as tinyint) from cp.`tpch/nation.parquet`;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -160,7 +160,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledCastSMALLINT() throws Exception {
     try {
       test("select cast(n_name as smallint) from cp.`tpch/nation.parquet`;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -169,7 +169,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledCastREAL() throws Exception {
     try {
       test("select cast(n_name as real) from cp.`tpch/nation.parquet`;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -178,7 +178,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
   public void testDisabledCardinality() throws Exception {
     try {
       test("select cardinality(employee_id) from cp.`employee.json`;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -188,7 +188,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
     try {
       test("select a.*, b.user_port " +
           "from cp.`employee.json` a, sys.drillbits b;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -199,7 +199,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.*, b.user_port " +
           "from cp.`employee.json` a, sys.drillbits b " +
           "where a.position_id <> b.user_port;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -210,7 +210,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.last_name, b.n_name, c.r_name " +
           "from cp.`employee.json` a, cp.`tpch/nation.parquet` b, cp.`tpch/region.parquet`
c " +
           "where a.position_id > b.n_nationKey and b.n_nationKey = c.r_regionkey;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -221,7 +221,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.lastname, b.n_name " +
           "from cp.`employee.json` a LEFT JOIN cp.`tpch/nation.parquet` b " +
           "ON a.position_id > b.n_nationKey;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -232,7 +232,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.lastname, b.n_name " +
           "from cp.`employee.json` a INNER JOIN cp.`tpch/nation.parquet` b " +
           "ON a.position_id > b.n_nationKey;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -245,7 +245,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
           "where b.n_nationkey = " +
           "(select r_regionkey from cp.`tpch/region.parquet` " +
           "where r_regionkey = 1)");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -256,7 +256,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.lastname " +
           "from cp.`employee.json` a " +
           "where exists (select n_name from cp.`tpch/nation.parquet` b) AND a.position_id
= 10");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -267,7 +267,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("explain plan for (select a.lastname, b.n_name " +
           "from cp.`employee.json` a INNER JOIN cp.`tpch/nation.parquet` b " +
           "ON a.position_id > b.n_nationKey);");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -278,7 +278,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("explain plan for (select a.lastname, b.n_name " +
           "from cp.`employee.json` a LEFT OUTER JOIN cp.`tpch/nation.parquet` b " +
           "ON (a.position_id > b.n_nationKey AND a.employee_id = b.n_regionkey));");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -289,7 +289,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
       test("select a.lastname, b.n_name " +
           "from cp.`employee.json` a RIGHT OUTER JOIN cp.`tpch/nation.parquet` b " +
           "ON (a.position_id > b.n_nationKey AND a.employee_id = b.n_regionkey);");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }
@@ -301,7 +301,7 @@ public class TestDisabledFunctionality extends BaseTestQuery{
           "OVER (PARTITION BY position_id order by position_id) " +
           "FROM cp.`employee.json` " +
           "order by employee_id;");
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       throwAsUnsupportedException(ex);
     }
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/TestStarQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestStarQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestStarQueries.java
index 3dfaf10..365acd9 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestStarQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestStarQueries.java
@@ -17,7 +17,7 @@
  */
 package org.apache.drill;
 
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.common.types.TypeProtos;
 import org.apache.drill.common.util.TestTools;
 import org.junit.Test;
@@ -263,11 +263,11 @@ public class TestStarQueries extends BaseTestQuery{
     test("select *, first_name, *, last_name from cp.`employee.json`;");
   }
 
-  @Test(expected = DrillUserException.class)  // Should get "At line 1, column 8: Column
'n_nationkey' is ambiguous"
+  @Test(expected = UserException.class)  // Should get "At line 1, column 8: Column 'n_nationkey'
is ambiguous"
   public void testSelStarAmbiguousJoin() throws Exception {
     try {
       test("select x.n_nationkey, x.n_name, x.n_regionkey, x.r_name from (select * from cp.`tpch/nation.parquet`
n, cp.`tpch/region.parquet` r where n.n_regionkey = r.r_regionkey) x " ) ;
-    } catch (DrillUserException e) {
+    } catch (UserException e) {
       logger.info("***** Test resulted in expected failure: " + e.getMessage());
       throw e;
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java b/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
index 3e00423..7749a2a 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
@@ -17,7 +17,7 @@
  */
 package org.apache.drill;
 
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.common.types.TypeProtos;
 import org.apache.drill.common.util.FileUtils;
 import org.apache.drill.exec.work.foreman.SqlUnsupportedException;
@@ -227,7 +227,7 @@ public class TestUnionAll extends BaseTestQuery{
       String query = "(select * from dfs_test.tmp.`nation_view_testunionall`) " +
                      "union all (select * from cp.`tpch/region.parquet`)";
       test(query);
-    } catch(DrillUserException ex) {
+    } catch(UserException ex) {
       SqlUnsupportedException.errorClassNameToException(ex.getOrCreatePBError(false).getException().getExceptionClass());
       throw ex;
     } finally {
@@ -356,7 +356,7 @@ public class TestUnionAll extends BaseTestQuery{
         .build().run();
   }
 
-  @Test(expected = DrillUserException.class) // see DRILL-2590
+  @Test(expected = UserException.class) // see DRILL-2590
   public void testUnionAllImplicitCastingFailure() throws Exception {
     String rootInt = FileUtils.getResourceAsFile("/store/json/intData.json").toURI().toString();
     String rootBoolean = FileUtils.getResourceAsFile("/store/json/booleanData.json").toURI().toString();

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
index 69c274c..7aee6d3 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
@@ -29,7 +29,7 @@ import org.apache.drill.QueryTestUtil;
 import org.apache.drill.SingleRowListener;
 import org.apache.drill.common.AutoCloseables;
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.common.types.TypeProtos.MinorType;
 import org.apache.drill.exec.ExecConstants;
 import org.apache.drill.exec.ExecTest;
@@ -312,7 +312,7 @@ public class TestDrillbitResilience extends ExecTest {
    * @param desc the expected exception site description
    */
   private static void assertInjected(
-      final DrillUserException caught, final Class<? extends Throwable> exceptionClass,
final String desc) {
+      final UserException caught, final Class<? extends Throwable> exceptionClass,
final String desc) {
     ExceptionWrapper cause = caught.getOrCreatePBError(false).getException();
     assertEquals(exceptionClass.getName(), cause.getExceptionClass());
     assertEquals(desc, cause.getMessage());
@@ -339,7 +339,7 @@ public class TestDrillbitResilience extends ExecTest {
     try {
       QueryTestUtil.test(drillClient, "select * from sys.drillbits");
       fail();
-    } catch(DrillUserException dre) {
+    } catch(UserException dre) {
       assertInjected(dre, ForemanException.class, desc);
     }
   }
@@ -365,7 +365,7 @@ public class TestDrillbitResilience extends ExecTest {
     try {
       QueryTestUtil.test(drillClient, "select * from sys.drillbits");
       fail();
-    } catch(DrillUserException dre) {
+    } catch(UserException dre) {
       assertInjected(dre, ForemanException.class, exceptionDesc);
     }
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetResultListener.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetResultListener.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetResultListener.java
index 3bcfbdf..3a794a9 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetResultListener.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetResultListener.java
@@ -23,8 +23,7 @@ import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 import java.util.HashMap;
 
-import org.apache.drill.common.exceptions.DrillUserException;
-import org.apache.drill.common.exceptions.ErrorHelper;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.common.types.TypeProtos;
 import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.memory.BufferAllocator;
@@ -62,7 +61,7 @@ public class ParquetResultListener implements UserResultsListener {
   }
 
   @Override
-  public void submissionFailed(DrillUserException ex) {
+  public void submissionFailed(UserException ex) {
     logger.error("Submission failed.", ex);
     future.setException(ex);
   }
@@ -170,7 +169,7 @@ public class ParquetResultListener implements UserResultsListener {
         }
         assertEquals("Record count incorrect for column: " + s, totalRecords, (long) valuesChecked.get(s));
       } catch (AssertionError e) {
-        submissionFailed(ErrorHelper.wrap(e));
+        submissionFailed(UserException.systemError(e).build());
       }
     }
 

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetPhysicalPlan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetPhysicalPlan.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetPhysicalPlan.java
index cde2e95..cfe52c2 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetPhysicalPlan.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetPhysicalPlan.java
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.exec.ExecTest;
 import org.apache.drill.exec.client.DrillClient;
 import org.apache.drill.exec.proto.UserBitShared.QueryId;
@@ -90,7 +90,7 @@ public class TestParquetPhysicalPlan extends ExecTest {
     private CountDownLatch latch = new CountDownLatch(1);
 
     @Override
-    public void submissionFailed(DrillUserException ex) {
+    public void submissionFailed(UserException ex) {
       logger.error("submission failed", ex);
       latch.countDown();
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java
index a9753bc..d2302fb 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java
@@ -29,7 +29,7 @@ import net.hydromatic.avatica.AvaticaPrepareResult;
 import net.hydromatic.avatica.AvaticaResultSet;
 import net.hydromatic.avatica.AvaticaStatement;
 
-import org.apache.drill.common.exceptions.DrillUserException;
+import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.exec.client.DrillClient;
 import org.apache.drill.exec.proto.UserBitShared.QueryId;
 import org.apache.drill.exec.proto.UserBitShared.QueryType;
@@ -160,7 +160,7 @@ public class DrillResultSetImpl extends AvaticaResultSet implements DrillResultS
   // (Public until JDBC impl. classes moved out of published-intf. package. (DRILL-2089).)
   public class ResultsListener implements UserResultsListener {
     private static final int MAX = 100;
-    private volatile DrillUserException ex;
+    private volatile UserException ex;
     volatile boolean completed = false;
     private volatile boolean autoread = true;
     private volatile ConnectionThrottle throttle;
@@ -183,7 +183,7 @@ public class DrillResultSetImpl extends AvaticaResultSet implements DrillResultS
     }
 
     @Override
-    public void submissionFailed(DrillUserException ex) {
+    public void submissionFailed(UserException ex) {
       this.ex = ex;
       completed = true;
       close();

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/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 9a095aa..acd8624 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
@@ -1953,84 +1953,196 @@ public final class UserBitShared {
         implements com.google.protobuf.ProtocolMessageEnum {
       /**
        * <code>CONNECTION = 0;</code>
+       *
+       * <pre>
+       * equivalent to SQLClientInfoException
+       * - handshake version error
+       * - invalid schema
+       * </pre>
        */
       CONNECTION(0, 0),
       /**
        * <code>DATA_READ = 1;</code>
+       *
+       * <pre>
+       * equivalent to SQLRecoverableException
+       * - corrupt files: can't be read. FS read error
+       * - parsing error due to incomplete or incorrectly written records
+       * </pre>
        */
       DATA_READ(1, 1),
       /**
        * <code>DATA_WRITE = 2;</code>
+       *
+       * <pre>
+       * equivalent to SQLDataException
+       * - data type unsupported by format
+       * </pre>
        */
       DATA_WRITE(2, 2),
       /**
        * <code>FUNCTION = 3;</code>
+       *
+       * <pre>
+       * equivalent to SQLDataException
+       * - Casting errors
+       * - function not found for incoming types after implicit casting
+       * - Flatten misuse
+       * </pre>
        */
       FUNCTION(3, 3),
       /**
        * <code>PARSE = 4;</code>
+       *
+       * <pre>
+       * equivalent to SQLSyntaxErrorException
+       * - typos
+       * - missing table
+       * - SQL keyword misuse
+       * - function names/resolution
+       * </pre>
        */
       PARSE(4, 4),
       /**
        * <code>PERMISSION = 5;</code>
+       *
+       * <pre>
+       * equivalent to SQLInvalidAuthorizationSpecException
+       * </pre>
        */
       PERMISSION(5, 5),
       /**
        * <code>PLAN = 6;</code>
+       *
+       * <pre>
+       * equivalent to SQLNonTransientException
+       * </pre>
        */
       PLAN(6, 6),
       /**
        * <code>RESOURCE = 7;</code>
+       *
+       * <pre>
+       * equivalent to SQLRecoverableException or SQLTransientException
+       * - Recoverable: memory, disk
+       * - Transient: network
+       * </pre>
        */
       RESOURCE(7, 7),
       /**
        * <code>SYSTEM = 8;</code>
+       *
+       * <pre>
+       * equivalent to SQLNonTransientException.
+       * </pre>
        */
       SYSTEM(8, 8),
       /**
        * <code>UNSUPPORTED_OPERATION = 9;</code>
+       *
+       * <pre>
+       * equivalent to SQLFeatureNotSupportedException
+       * - type change
+       * - schema change
+       * </pre>
        */
       UNSUPPORTED_OPERATION(9, 9),
       ;
 
       /**
        * <code>CONNECTION = 0;</code>
+       *
+       * <pre>
+       * equivalent to SQLClientInfoException
+       * - handshake version error
+       * - invalid schema
+       * </pre>
        */
       public static final int CONNECTION_VALUE = 0;
       /**
        * <code>DATA_READ = 1;</code>
+       *
+       * <pre>
+       * equivalent to SQLRecoverableException
+       * - corrupt files: can't be read. FS read error
+       * - parsing error due to incomplete or incorrectly written records
+       * </pre>
        */
       public static final int DATA_READ_VALUE = 1;
       /**
        * <code>DATA_WRITE = 2;</code>
+       *
+       * <pre>
+       * equivalent to SQLDataException
+       * - data type unsupported by format
+       * </pre>
        */
       public static final int DATA_WRITE_VALUE = 2;
       /**
        * <code>FUNCTION = 3;</code>
+       *
+       * <pre>
+       * equivalent to SQLDataException
+       * - Casting errors
+       * - function not found for incoming types after implicit casting
+       * - Flatten misuse
+       * </pre>
        */
       public static final int FUNCTION_VALUE = 3;
       /**
        * <code>PARSE = 4;</code>
+       *
+       * <pre>
+       * equivalent to SQLSyntaxErrorException
+       * - typos
+       * - missing table
+       * - SQL keyword misuse
+       * - function names/resolution
+       * </pre>
        */
       public static final int PARSE_VALUE = 4;
       /**
        * <code>PERMISSION = 5;</code>
+       *
+       * <pre>
+       * equivalent to SQLInvalidAuthorizationSpecException
+       * </pre>
        */
       public static final int PERMISSION_VALUE = 5;
       /**
        * <code>PLAN = 6;</code>
+       *
+       * <pre>
+       * equivalent to SQLNonTransientException
+       * </pre>
        */
       public static final int PLAN_VALUE = 6;
       /**
        * <code>RESOURCE = 7;</code>
+       *
+       * <pre>
+       * equivalent to SQLRecoverableException or SQLTransientException
+       * - Recoverable: memory, disk
+       * - Transient: network
+       * </pre>
        */
       public static final int RESOURCE_VALUE = 7;
       /**
        * <code>SYSTEM = 8;</code>
+       *
+       * <pre>
+       * equivalent to SQLNonTransientException.
+       * </pre>
        */
       public static final int SYSTEM_VALUE = 8;
       /**
        * <code>UNSUPPORTED_OPERATION = 9;</code>
+       *
+       * <pre>
+       * equivalent to SQLFeatureNotSupportedException
+       * - type change
+       * - schema change
+       * </pre>
        */
       public static final int UNSUPPORTED_OPERATION_VALUE = 9;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/238399de/protocol/src/main/protobuf/UserBitShared.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto
index 10c2790..7383bd2 100644
--- a/protocol/src/main/protobuf/UserBitShared.proto
+++ b/protocol/src/main/protobuf/UserBitShared.proto
@@ -31,15 +31,51 @@ message QueryId {
 
 message DrillPBError{
   enum ErrorType {
+    /* equivalent to SQLClientInfoException
+     * - handshake version error
+     * - invalid schema
+     */
     CONNECTION = 0;
+    /* equivalent to SQLRecoverableException
+     * - corrupt files: can't be read. FS read error
+     * - parsing error due to incomplete or incorrectly written records
+     */
     DATA_READ = 1;
+    /* equivalent to SQLDataException
+     * - data type unsupported by format
+     */
     DATA_WRITE = 2;
+    /* equivalent to SQLDataException
+     * - Casting errors
+     * - function not found for incoming types after implicit casting
+     * - Flatten misuse
+     */
     FUNCTION = 3;
+    /* equivalent to SQLSyntaxErrorException
+     * - typos
+     * - missing table
+     * - SQL keyword misuse
+     * - function names/resolution
+     */
     PARSE = 4;
+    /* equivalent to SQLInvalidAuthorizationSpecException
+     */
     PERMISSION = 5;
+    /* equivalent to SQLNonTransientException
+     */
     PLAN = 6;
+    /* equivalent to SQLRecoverableException or SQLTransientException
+     * - Recoverable: memory, disk
+     * - Transient: network
+     */
     RESOURCE = 7;
+    /* equivalent to SQLNonTransientException.
+     */
     SYSTEM = 8;
+    /* equivalent to SQLFeatureNotSupportedException
+     * - type change
+     * - schema change
+     */
     UNSUPPORTED_OPERATION = 9;
   }
   optional string error_id = 1; // for debug tracing purposes


Mime
View raw message