From b24dfa166bb4e21477ef0e482eb1454ebc5ff363 Mon Sep 17 00:00:00 2001 From: Robert Hou Date: Thu, 6 Sep 2018 15:23:45 -0700 Subject: [PATCH] Update Test Framework to handle SQL Exception when extracting rows from resultSet. --- .../org/apache/drill/test/framework/DrillTestJdbc.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framework/src/main/java/org/apache/drill/test/framework/DrillTestJdbc.java b/framework/src/main/java/org/apache/drill/test/framework/DrillTestJdbc.java index a3f8413d6..926559736 100644 --- a/framework/src/main/java/org/apache/drill/test/framework/DrillTestJdbc.java +++ b/framework/src/main/java/org/apache/drill/test/framework/DrillTestJdbc.java @@ -258,6 +258,14 @@ private void executeQuery(String query) throws IOException, SQLException { } catch (IllegalArgumentException | IllegalAccessException | IOException e1) { LOG.warn(e1); + } catch (SQLException e) { + if (writer != null) { + writer.write(e.getErrorCode() + "\t" + e.getMessage()); + writer.close(); + } + if (resultSet != null) {resultSet.close();} + if (modeler.negative) {return;} + throw e; } finally { doneProcessingResultSet.set(true); if (resultSet != null) {