mattyb149 commented on a change in pull request #5366:
URL: https://github.com/apache/nifi/pull/5366#discussion_r738790838



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/Oracle12DatabaseAdapter.java
##########
@@ -93,4 +100,98 @@ public String getSelectStatement(String tableName, String 
columnNames, String wh
     public String getTableAliasClause(String tableName) {
         return tableName;
     }
+
+    @Override
+    public boolean supportsUpsert() {
+       return true;
+    }
+
+    @Override
+    public String getUpsertStatement(String table, List<String> columnNames, 
Collection<String> uniqueKeyColumnNames) {
+        Preconditions.checkArgument(!StringUtils.isEmpty(table), "Table name 
cannot be null or blank");

Review comment:
       These should throw an `IllegalArgumentException` rather than using the 
`Preconditions` class from an Avro shaded JAR. The conditions are simple enough 
that the code will still be readable but without the possible performance hit 
of using `Preconditions`

##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/Oracle12DatabaseAdapter.java
##########
@@ -16,9 +16,16 @@
  */
 package org.apache.nifi.processors.standard.db.impl;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.processors.standard.db.DatabaseAdapter;
 
+import avro.shaded.com.google.common.base.Preconditions;
+
 /**
  * A database adapter that generates MS SQL Compatible SQL.

Review comment:
       Do you mind updating this comment? It was an oversight by copying from 
another adapter. Thanks!




-- 
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...@nifi.apache.org

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


Reply via email to