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



##########
File path: 
nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-processors/src/main/java/org/apache/nifi/processors/kudu/AbstractKuduProcessor.java
##########
@@ -412,6 +415,26 @@ protected void buildPartialRow(Schema schema, PartialRow 
row, Record record, Lis
         }
     }
 
+    /**
+     * Get java.sql.Date from Record Field Value with optional parsing when 
input value is a String
+     *
+     * @param value Record Field Value
+     * @param recordFieldName Record Field Name
+     * @return Date object or null when value is null
+     */
+    private Date getDate(final Object value, final String recordFieldName) {
+        return DataTypeUtils.toDate(value, () -> getDateFormat(), 
recordFieldName);
+    }
+
+    /**
+     * Get Date Format using Date Record Field default pattern and system time 
zone to avoid unnecessary conversion
+     *
+     * @return Date Format used to parsing date fields
+     */
+    private DateFormat getDateFormat() {
+        return new SimpleDateFormat(RecordFieldType.DATE.getDefaultFormat());

Review comment:
       Should this use `fieldType.getFormat()` similar to the handling for 
Timestamp/UNIXTIME_MICROS above?




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