[
https://issues.apache.org/jira/browse/NIFI-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125661#comment-16125661
]
ASF GitHub Bot commented on NIFI-2829:
--------------------------------------
Github user yjhyjhyjh0 commented on the issue:
https://github.com/apache/nifi/pull/2082
Thanks for the detail explanation.
Indeed using local time zone is more reasonable.
Didn’t notice the date will be transform into local time zone once with
value format.
Just want to point out that I first try the approach you mentioned (use
local time zone) will encounter problem with Time type.
My time zone is UTC+8, which cause time string “01:01:01” in Time type will
become negative long value.
This reasonable because Time type only consider time without epoch so it
will be negative if it’s earlier than “08:00:00”.
However this will not pass the LONG_PATTERN in PutSQL and thus consider a
negative long value to be in format "HH:mm:ss.SSS” instead of long.
This will encounter error while parsing for sure :
java.text.ParseException: Unparseable date: “-28739000”.
If I try your commit with changing the timeStr to “01:01:01" in
testUsingDateTimeValuesWithFormatAttribute will encounter negative long parsing
problem which mentioned above.
Don’t know if you will encounter similar problem with **negative long value
in Time type**, too?
I've try your commit together with LONG_PATTERN that also match negative
long value ("^-?\\d{1,19}$”) today and everything works fine now.
Thanks for any response.
> PutSQL assumes all Date and Time values are provided in Epoch
> -------------------------------------------------------------
>
> Key: NIFI-2829
> URL: https://issues.apache.org/jira/browse/NIFI-2829
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Reporter: Paul Gibeault
> Assignee: Peter Wicks
> Fix For: 1.4.0
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> This bug is the same as NIFI-2576 only extended to data types DATE and TIME.
> https://issues.apache.org/jira/browse/NIFI-2576
> When PutSQL sees a DATE or TIME data type it assumes that it's being provided
> as a Long in Epoch format.
> This doesn't make much sense since the Query Database tools that return Avro
> return DATES and TIME values as strings; and thus following the
> Avro->JSON->JSON To SQL Route leads to DATE and TIME fields as being strings.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)