You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Shawn Weeks <sw...@weeksconsulting.us> on 2019/04/26 00:39:37 UTC

PutHive3Streaming Doesn't Work with String Timestamps

Trying to figure out the correct way to stream timestamps as it appears that using the Hive String Timestamp format no longer works.

Error [java.lang.NumberFormatException: For input string: "2019-04-26 00:05:00.363"]

Also What about dates?

Thanks
Shawn Weeks

RE: PutHive3Streaming Doesn't Work with String Timestamps

Posted by Shawn Weeks <sw...@weeksconsulting.us>.
Built a sample test for this for date as well and I get this error. If I go look at RecordFieldType.DATE it shows the format as DATE("date", "yyyy-MM-dd") which is what I'm using. Same with timestamp TIMESTAMP("timestamp", "yyyy-MM-dd HH:mm:ss")

PutHive3Streaming[id=8a4f32d4-0169-1000-0000-000045f0eabb]
Error [org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Could not convert value [2019-01-01] of type java.lang.String to Date
because the value is not in the expected date format: org.apache.nifi.serialization.record.MapRecord$$Lambda$1216/421560596@5794948d
for field c_date] parsing Record [OW[class=class org.apache.nifi.serialization.record.MapRecord,value=MapRecord[{c_string=Hello World, c_timestamp=2019-01-01 09:23:15, c_date=2019-01-01}]]].:

See attached example...

Thanks
Shawn Weeks

From: Shawn Weeks <sw...@weeksconsulting.us>
Sent: Thursday, April 25, 2019 7:40 PM
To: users@nifi.apache.org
Subject: PutHive3Streaming Doesn't Work with String Timestamps

Trying to figure out the correct way to stream timestamps as it appears that using the Hive String Timestamp format no longer works.

Error [java.lang.NumberFormatException: For input string: "2019-04-26 00:05:00.363"]

Also What about dates?

Thanks
Shawn Weeks