frankgh commented on code in PR #120:
URL: 
https://github.com/apache/cassandra-analytics/pull/120#discussion_r2157497144


##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/WriterOptions.java:
##########
@@ -45,6 +45,7 @@ public enum WriterOptions implements WriterOption
     COMMIT_THREADS_PER_INSTANCE,
     COMMIT_BATCH_SIZE,
     SKIP_EXTENDED_VERIFY,
+    SKIP_ROWS_VIOLATING_CONSTRAINTS,

Review Comment:
   Can you maybe add a comment here that this feature is only available in 
Cassandra 5.0 version? Or is it 6?



##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriter.java:
##########
@@ -137,8 +141,24 @@ public void addRow(BigInteger token, Map<String, Object> 
boundValues) throws IOE
         }
         // rows are sorted. Therefore, only update the maxToken
         maxToken = token;
-        cqlSSTableWriter.addRow(boundValues);
-        rowCount += 1;
+        try
+        {
+            cqlSSTableWriter.addRow(boundValues);
+            rowCount += 1;
+        }
+        catch (Throwable t)
+        {
+            if (t.getCause() != null && 
t.getCause().getClass().getName().equals("org.apache.cassandra.cql3.constraints.ConstraintViolationException"))

Review Comment:
   I was going to suggest using `ThrowableUtils` , but it looks like the 
Analytics version of this class is less featured than the Sidecar version of 
`ThrowableUtils` .



##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriter.java:
##########
@@ -137,8 +141,24 @@ public void addRow(BigInteger token, Map<String, Object> 
boundValues) throws IOE
         }
         // rows are sorted. Therefore, only update the maxToken
         maxToken = token;
-        cqlSSTableWriter.addRow(boundValues);
-        rowCount += 1;
+        try
+        {
+            cqlSSTableWriter.addRow(boundValues);
+            rowCount += 1;
+        }
+        catch (Throwable t)
+        {
+            if (t.getCause() != null && 
t.getCause().getClass().getName().equals("org.apache.cassandra.cql3.constraints.ConstraintViolationException"))

Review Comment:
   Tiny NIT:
   ```suggestion
               if (t.getCause() != null && 
"org.apache.cassandra.cql3.constraints.ConstraintViolationException".equals(t.getCause().getClass().getName()))
   ```



-- 
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: commits-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to