ankitjain64 commented on a change in pull request #1300:
URL: https://github.com/apache/phoenix/pull/1300#discussion_r706509985
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
##########
@@ -754,6 +817,28 @@ private void assertRow(Connection conn, String tableName,
String expectedPK, int
assertFalse(rs.next());
}
+ private void upsertRecord(Connection conn, String dml, String orgid,
String userid, long ts, String status) throws SQLException {
+ try(PreparedStatement stmt = conn.prepareStatement(dml)) { // regular
upsert
+ stmt.setString(1, orgid);
+ stmt.setString(2, userid);
+ stmt.setDate(3, new Date(ts));
+ stmt.setString(4, status); // status should change now
+ stmt.executeUpdate();
+ conn.commit();
+ }
+ }
+
+ private void assertNumRecords(int count, Connection conn, String dql,
String... params)
+ throws Exception {
+ PreparedStatement stmt = conn.prepareStatement(dql);
+ int counter = 1;
+ for (String param : params) {
+ stmt.setString(counter++, param);
+ }
+ ResultSet rs = stmt.executeQuery();
+ assertTrue(rs.next());
+ assertEquals(count, rs.getInt(1));
Review comment:
from the jira description looks like we want to make sure correct
timestamps are used for the mutation but we are not validating that in the test
case and just the row count. Is that sufficient @tkhurana ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]