exceptionfactory commented on a change in pull request #4931:
URL: https://github.com/apache/nifi/pull/4931#discussion_r600474873



##########
File path: 
nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/src/main/java/org/apache/nifi/accumulo/processors/ScanAccumulo.java
##########
@@ -254,7 +258,12 @@ public void process(final InputStream in, final 
OutputStream out) throws IOExcep
 
                             try{
                                 final RecordSchema writeSchema = 
writerFactory.getSchema(flowAttributes, new KeySchema());
-                                try (final RecordSetWriter writer = 
writerFactory.createWriter(getLogger(), writeSchema, out)) {
+                                List<RecordField> fieldList = new 
ArrayList<>();

Review comment:
       Recommend declaring this variable and other variables as `final` 
following the general pattern of the Processor.  Renaming the variable to 
something like `writeSchemaFields` or `recordSchemaFields` would also be 
helpful.

##########
File path: 
nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/src/main/java/org/apache/nifi/accumulo/processors/ScanAccumulo.java
##########
@@ -254,7 +258,12 @@ public void process(final InputStream in, final 
OutputStream out) throws IOExcep
 
                             try{
                                 final RecordSchema writeSchema = 
writerFactory.getSchema(flowAttributes, new KeySchema());
-                                try (final RecordSetWriter writer = 
writerFactory.createWriter(getLogger(), writeSchema, out)) {
+                                List<RecordField> fieldList = new 
ArrayList<>();
+                                fieldList.addAll(writeSchema.getFields());
+                                fieldList.add(new RecordField("value", 
RecordFieldType.STRING.getDataType()));

Review comment:
       The Accumulo `Value` object contains a byte array which can be converted 
to UTF-8 String, but does conversion to String cover all use cases?

##########
File path: 
nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/src/main/java/org/apache/nifi/accumulo/processors/ScanAccumulo.java
##########
@@ -270,8 +279,9 @@ public void process(final InputStream in, final 
OutputStream out) throws IOExcep
                                         data.put("columnQualifier", 
key.getColumnQualifier().toString());
                                         data.put("columnVisibility", 
key.getColumnVisibility().toString());
                                         data.put("timestamp", 
key.getTimestamp());
+                                        data.put("value", kv.getValue());

Review comment:
       As mentioned in the RecordField definition, `Value.toString()` converts 
the underlying byte array to a UTF-8 encoded String.  If that covers all use 
cases, this should be changed to `kv.getValue().toString()`.  Alternatively, if 
the underlying byte array should be represented, this should be changed to 
`kv.getValue().get()` and the RecordFieldType should be changed,




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


Reply via email to