haridsv commented on code in PR #1766: URL: https://github.com/apache/phoenix/pull/1766#discussion_r1435015447
########## phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCMiscIT.java: ########## @@ -269,4 +273,109 @@ public void testDropCDCIndex () throws SQLException { } } + private void assertResultSet(ResultSet rs) throws Exception{ + Gson gson = new Gson(); + assertEquals(true, rs.next()); + assertEquals(1, rs.getInt(2)); + assertEquals(new HashMap(){{put("V1", 100d);}}, gson.fromJson(rs.getString(3), + HashMap.class)); + assertEquals(true, rs.next()); + assertEquals(2, rs.getInt(2)); + assertEquals(new HashMap(){{put("V1", 200d);}}, gson.fromJson(rs.getString(3), + HashMap.class)); + assertEquals(true, rs.next()); + assertEquals(1, rs.getInt(2)); + assertEquals(new HashMap(){{put("V1", 101d);}}, gson.fromJson(rs.getString(3), + HashMap.class)); + assertEquals(false, rs.next()); + rs.close(); + } + + @Test + public void testSelectCDC() throws Exception { + Properties props = new Properties(); + props.put(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB, Long.toString(Long.MAX_VALUE)); + props.put("hbase.client.scanner.timeout.period", "6000000"); + props.put("phoenix.query.timeoutMs", "6000000"); + props.put("zookeeper.session.timeout", "6000000"); + props.put("hbase.rpc.timeout", "6000000"); + Connection conn = DriverManager.getConnection(getUrl(), props); + String tableName = generateUniqueName(); + conn.createStatement().execute( + "CREATE TABLE " + tableName + " ( k INTEGER PRIMARY KEY," + " v1 INTEGER)"); + conn.createStatement().execute("UPSERT INTO " + tableName + " (k, v1) VALUES (1, 100)"); + conn.createStatement().execute("UPSERT INTO " + tableName + " (k, v1) VALUES (2, 200)"); + conn.commit(); + Thread.sleep(1000); + conn.createStatement().execute("UPSERT INTO " + tableName + " (k, v1) VALUES (1, 101)"); + conn.commit(); + String cdcName = generateUniqueName(); + String cdc_sql = "CREATE CDC " + cdcName Review Comment: @tkhurana In any case, I am not planning to address these as part of this PR, so are you OK to merge this as is? -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org