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/09/24 17:45:05 UTC

[GitHub] [nifi] granthenke commented on a change in pull request #4549: [nifi-7565] Support for Kudu DATE type

granthenke commented on a change in pull request #4549:
URL: https://github.com/apache/nifi/pull/4549#discussion_r494497788



##########
File path: nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-processors/src/main/java/org/apache/nifi/processors/kudu/AbstractKuduProcessor.java
##########
@@ -352,6 +351,9 @@ protected void buildPartialRow(Schema schema, PartialRow row, Record record, Lis
                         case VARCHAR:
                             row.addVarchar(colIdx, DataTypeUtils.toString(value, recordFieldName));
                             break;
+                        case DATE:
+                            row.addDate(colIdx, DataTypeUtils.toDate(value, () -> DataTypeUtils.getDateFormat("yyyy-MM-dd"), recordFieldName));

Review comment:
       Maybe use `DataTypeUtils.getDateFormat(RecordFieldType.DATE.getDefaultFormat());` like is done here: https://github.com/apache/nifi/blob/main/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java#L109
   
   What if the string is in a different format? Do we expect that a user would transform their data? Do other processors handle this?




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