nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Thomsen <mikerthom...@gmail.com>
Subject Re: Date format bug in 1.8 that got fixed in 1.9
Date Tue, 11 Dec 2018 17:03:01 GMT
Forgot to mention that there is a workaround that worked for me:

format(toDate(toString(/fieldName, "UTF-8"), "yyyy-MM-dd HH:mm:ss"),
"yyyy-MM-dd HH:mm:ss")

On Tue, Dec 11, 2018 at 11:31 AM Mike Thomsen <mikerthomsen@gmail.com>
wrote:

> FYI, ran into this bug. It's fixed in 1.9.0-SNAPSHOT
>
> 1. Declare an avro timestamp-millis field.
> 2. Try to convert to string with format(/fieldName, "yyyy-MM-dd")
>
> Get an exception saying DataTypeUtils cannot convert java.sql.Timestamp to
> java.sql.Date
>
> This is the line that fixed it, FWIW, in 1.9.0-SNAPSHOT (sharing so others
> can give it a quick review):
>
> if (value instanceof java.util.Date) {
>     java.util.Date _temp = (java.util.Date)value;
>     return new Date(_temp.getTime());
> }
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message