mattyb149 commented on a change in pull request #3977: NIFI-7007 Add update 
functionality to the PutCassandraRecord processor.
URL: https://github.com/apache/nifi/pull/3977#discussion_r366564750
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/PutCassandraRecord.java
 ##########
 @@ -67,6 +75,35 @@
             .required(true)
             .build();
 
+    static final PropertyDescriptor STATEMENT_TYPE = new 
PropertyDescriptor.Builder()
+            .name("put-cassandra-record-statement-type")
+            .displayName("Statement Type")
+            .description("Specifies the type of CQL Statement to generate.")
+            .required(true)
+            .defaultValue(INSERT_TYPE)
+            .allowableValues(UPDATE_TYPE, INSERT_TYPE)
+            .build();
+
+    static final PropertyDescriptor UPDATE_METHOD = new 
PropertyDescriptor.Builder()
+            .name("put-cassandra-record-update-method")
+            .displayName("Update Method")
+            .description("Specifies the method to use to SET the values.")
 
 Review comment:
   This should include in the description that the property is only used if the 
Statement Type is Update, and ignored otherwise.
   
   Also, do you anticipate multiple flow files coming in, each needing a 
different Update Method? You can't use Expression Language with 
AllowableValues/dropdowns, but a common pattern is to have an AllowableValue 
whose display name is `Use cql.update.method attribute`, and if that is chosen, 
the `cql.update.method` attribute is expected to be set to the name of one of 
the available options. See PutDatabaseRecord for an example of this pattern. 
Same goes for the Statement Type, if you allow that to be set by an attribute, 
then you could send all flow files to one PutCassandraRecord instance, rather 
than having to route on type and then send to 2+ instances (one for INSERT, one 
for UPDATE, e.g.)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to