phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] swaroopak commented on a change in pull request #474: PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance
Date Fri, 05 Apr 2019 19:03:58 GMT
swaroopak commented on a change in pull request #474: PHOENIX-5224 Change 'Statement' to 'PreparedStatement'
for better performance
URL: https://github.com/apache/phoenix/pull/474#discussion_r272709431
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexRebuildIncrementDisableCountIT.java
 ##########
 @@ -168,10 +169,14 @@ private static void mutateRandomly(Connection conn, String tableName,
int maxOrg
         try {
 
             Statement stmt = conn.createStatement();
+            String sqlStr = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?)"; 
+            PreparedStatement stmt = conn.prepareStatement(sqlStr);
             for (int i = 0; i < 10000; i++) {
-                stmt.executeUpdate(
-                    "UPSERT INTO " + tableName + " VALUES('" + getRandomOrgId(maxOrgId) +
"'," + i
-                            + "," + (i + 1) + "," + (i + 2) + ")");
+                stmt.setString(1, getRandomOrgId(maxOrgId);
 
 Review comment:
   missing closing parenthesis.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message