odbozhou commented on code in PR #318:
URL: https://github.com/apache/rocketmq-connect/pull/318#discussion_r980778773


##########
connectors/rocketmq-connect-cassandra/src/main/java/org/apache/rocketmq/connect/cassandra/sink/Updater.java:
##########
@@ -126,7 +96,46 @@ private Boolean updateRow(String dbName, String tableName, 
Map<Field, Object[]>
         boolean finishUpdate = false;
         log.info("trying to execute sql query,{}", regularInsert.asCql());
         try {
-            while (!cqlSession.isClosed() && !finishUpdate){
+            while (!cqlSession.isClosed() && !finishUpdate) {
+                stmt = regularInsert.build();
+                ResultSet result = cqlSession.execute(stmt);
+                if (result.wasApplied()) {
+                    log.info("update table success, executed cql query {}", 
regularInsert.asCql());
+                    return true;
+                }
+                finishUpdate = true;
+            }
+        } catch (Exception e) {
+            log.error("update table error,{}", e);
+        }
+        return false;
+    }
+
+    private Boolean updateRow(String dbName, String tableName, Object object) {
+        log.info("Updater.updateRow() get called ");
+        final Struct struct = JSON.parseObject(object.toString(), 
Struct.class);

Review Comment:
   This should not be a correct use of SCHEMA, and the data of ConnectRecord 
should be parsed by its own schema, and should not be parsed by serialized to 
struct



-- 
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]

Reply via email to