pgyori commented on a change in pull request #5388:
URL: https://github.com/apache/nifi/pull/5388#discussion_r712209141



##########
File path: 
nifi-commons/nifi-record/src/test/java/org/apache/nifi/serialization/record/ResultSetRecordSetTest.java
##########
@@ -157,10 +142,31 @@ public void testCreateSchemaWhenOtherType() throws 
SQLException {
         assertEquals(RecordFieldType.DECIMAL.getDecimalDataType(30, 10), 
resultSchema.getField(0).getDataType());
     }
 
+    @Test
+    public void testCreateSchemaWhenOtherTypeAndNoLogicalTypes() throws 
SQLException {
+        // given
+        final List<RecordField> fields = new ArrayList<>();
+        fields.add(new RecordField("decimal", 
RecordFieldType.DECIMAL.getDecimalDataType(30, 10)));
+        fields.add(new RecordField("date", 
RecordFieldType.DATE.getDataType()));
+        fields.add(new RecordField("time", 
RecordFieldType.TIME.getDataType()));
+        fields.add(new RecordField("timestamp", 
RecordFieldType.TIMESTAMP.getDataType()));
+        final RecordSchema recordSchema = new SimpleRecordSchema(fields);
+        final ResultSet resultSet = givenResultSetForOther(fields);
+
+        // when
+        final ResultSetRecordSet testSubject = new 
ResultSetRecordSet(resultSet, recordSchema, 10, 0, false);
+        final RecordSchema resultSchema = testSubject.getSchema();
+
+        // then
+        assertEquals(RecordFieldType.STRING.getDataType(), 
resultSchema.getField(0).getDataType());

Review comment:
       That's correct. Thank you for pointing that out! I forgot to add the 
loop for checking all the fields.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to