- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
toNumber() function NOT returning a number
- Labels:
-
Apache NiFi
Created 02-08-2023 02:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When attempting to insert a timestamp in milliseconds into a flowfile using the UpdateRecord processor, the timestamp comes out expressed as a string (first image) despite the fact that I've explicitly cast it as a number (second image). How can I get this expressed as a number like it is supposed to?
Created 02-08-2023 06:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I resorted to using an Avro schema with the RecordsetWriter in order to coerce the values into numbers. So even though the documentation says toNumber's return type is "Number", it doesn't get expressed that way. But the schema fixes it so its all good.
Created 02-08-2023 06:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I resorted to using an Avro schema with the RecordsetWriter in order to coerce the values into numbers. So even though the documentation says toNumber's return type is "Number", it doesn't get expressed that way. But the schema fixes it so its all good.
