Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/867#discussion_r125600260
--- Diff:
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestExecutionExceptionsToClient.java
---
@@ -192,4 +192,28 @@ public void testMaterializingError() throws Exception {
throw e;
}
}
+
+ @Test(expected = SQLException.class)
+ public void testConvertFromError() throws Exception {
+ final Statement statement = connection.createStatement();
+ try {
+ statement.executeUpdate("select CONVERT_FROM('1','INTEGER') from
(values(1))");
+ } catch (SQLException e) {
+ assertThat("Null getCause(); missing expected wrapped exception",
+ e.getCause(), notNullValue());
+
+ assertThat("Unexpectedly wrapped another SQLException",
+ e.getCause(), not(instanceOf(SQLException.class)));
+
+ assertThat("getCause() not UserRemoteException as expected",
+ e.getCause(), instanceOf(UserRemoteException.class));
+
+ assertThat("No expected current \"UNSUPPORTED_OPERATION ERROR\"",
+ e.getMessage(), startsWith("UNSUPPORTED_OPERATION ERROR"));
+
+ assertThat("No expected current \"Did you mean\"",
+ e.getMessage(), containsString("Did you mean"));
+ throw e;
--- End diff --
Thanks, done that.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---