Oliverwqcwrw commented on code in PR #318:
URL: https://github.com/apache/rocketmq-connect/pull/318#discussion_r981882029
##########
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:
thanks for your review, i have solved it
The value has been changed to automatic processing by configuring
valueConverter
--
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]