You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:43:18 UTC

[GitHub] [nifi] davidvoit commented on a change in pull request #4035: NIFI-7097: ResultSetRecordSet: Always use RecordField from readerSchema if applicable.

davidvoit commented on a change in pull request #4035:
URL: https://github.com/apache/nifi/pull/4035#discussion_r430248126



##########
File path: nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/TestResultSetRecordSet.java
##########
@@ -0,0 +1,168 @@
+package org.apache.nifi.serialization.record;

Review comment:
       No code before the License header

##########
File path: nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java
##########
@@ -153,25 +153,32 @@ private static RecordSchema createSchema(final ResultSet rs, final RecordSchema
             final int column = i + 1;
             final int sqlType = metadata.getColumnType(column);
 
-            final DataType dataType = getDataType(sqlType, rs, column, readerSchema);
             final String fieldName = metadata.getColumnLabel(column);
+            Optional<RecordField> readerField = readerSchema == null ? Optional.empty() : readerSchema.getField(fieldName);

Review comment:
       I'm not too sure if the readerField Optinoal should be inlined in the if block, as it is only used in the ture case. But as it checks readerSchema available and field available this could be fine.




----------------------------------------------------------------
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:
users@infra.apache.org