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);