From 6afbb8b6b3d7231a8d22357513648f22ba7e3795 Mon Sep 17 00:00:00 2001 From: bd2019us Date: Mon, 25 Feb 2019 21:42:51 -0600 Subject: [PATCH] use PreparedStatement --- .../java/org/apache/hadoop/vertica/VerticaOutputFormat.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contrib/vertica/src/java/org/apache/hadoop/vertica/VerticaOutputFormat.java b/src/contrib/vertica/src/java/org/apache/hadoop/vertica/VerticaOutputFormat.java index 93d10c00..d6b98ba5 100644 --- a/src/contrib/vertica/src/java/org/apache/hadoop/vertica/VerticaOutputFormat.java +++ b/src/contrib/vertica/src/java/org/apache/hadoop/vertica/VerticaOutputFormat.java @@ -207,10 +207,12 @@ public static void optimize(Configuration conf) throws Exception { // poll for refresh complete boolean refreshing = true; Long timeout = vtconfig.getOptimizePollTimeout(); + PreparedStatement prepareStmt = conn.prepareStatement("select table_name, status from vt_projection_refresh"); while (refreshing) { refreshing = false; - rs = stmt - .executeQuery("select table_name, status from vt_projection_refresh"); + //rs = stmt + // .executeQuery("select table_name, status from vt_projection_refresh"); + rs = prepareStmt.executeQuery(); while (rs.next()) { String table = rs.getString(1); String stat = rs.getString(2);