[ 
https://issues.apache.org/jira/browse/NIFI-8768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17380153#comment-17380153
 ] 

ASF subversion and git services commented on NIFI-8768:
-------------------------------------------------------

Commit 05d7867a1689c27b5b229480dab716f0a047f4b8 in nifi's branch 
refs/heads/main from David Handermann
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=05d7867 ]

NIFI-8768 Added toLocalDate() for convertType() handling of DATE fields

- Updated PutKudu to use DataTypeUtils.toLocalDate() for DATE fields
- Updated PutDatabaseRecord to remove convertDateToLocalTZ() since 
convertType() uses toLocalDate()
- Updated PutElasticsearchHttpRecord to use default time zone format for DATE 
fields
- Updated WriteXMLResult to use default time zone format for DATE fields
- Updated WriteJsonResult to use default time zone format for DATE fields
- Updated AvroTypeUtil to use toLocalDate() for logical DATE fields
- Updated JdbcCommon to avoid conversion to UTC for logical DATE fields
- Updated Processor and RecordReader unit tests for consistency in DATE 
comparison

Signed-off-by: Matthew Burgess <[email protected]>

This closes #5210


> Incorrect Date Parsing from String in Record Readers
> ----------------------------------------------------
>
>                 Key: NIFI-8768
>                 URL: https://issues.apache.org/jira/browse/NIFI-8768
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.14.0, 1.13.2
>            Reporter: David Handermann
>            Assignee: David Handermann
>            Priority: Major
>             Fix For: 1.15.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Multiple Record Reader implementations leverage 
> {{DataTypeUtils.convertType()}} to convert field values to an expected type 
> of object. The {{RecordFieldType.DATE}} indicates that the field should be 
> converted into a {{java.sql.Date}} object and currently relies on 
> {{DataTypeUtils.toDate()}} to handle the conversion. When the input value of 
> {{convertType()}} is a String such as {{2000-01-01}}, the resulting 
> {{java.sql.Date}} has one day subtracted, returning {{1999-12-31}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to