- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Transform a float value into integer using JoltTransformJSON in NiFi
- Labels:
-
Apache NiFi
Created 01-14-2025 03:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I'm trying to convert float values on my flow files into integers. My Jolt Specification looks like this:
[
{
"operation": "modify-default-beta",
"spec": {
"progress": "=toInteger",
"setup_value": "=toDouble",
"proposed_setup_cost": "=toDouble",
"real_setup_cost": "=toDouble",
"invoiced_value": "=toDouble",
"last_recognized_value": "=toDouble",
"starting_date": ["=toDateTime", "yyyy-MM-dd HH:mm:ss", "coerceOrNull"],
"last_progress_change": ["=toDateTime", "yyyy-MM-dd HH:mm:ss", "coerceOrNull"],
"end_date": ["=toDateTime", "yyyy-MM-dd HH:mm:ss", "coerceOrNull"]
}
}
]
But somehow my "progress" value is still being outputted like a float. If I have the value 100.0, it is not transformed to 100, for example. I also tried using "=toInteger(@(1,value))", but that also didn't worked.
Created 01-20-2025 02:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @enguias
Try using "modify-overwrite-beta" instead of the "modify-default-beta", it should work.
Created 01-14-2025 05:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@enguias Welcome to the Cloudera Community!
To help you get the best possible solution, I have tagged our NiFi experts @MattWho @SAMSAL who may be able to assist you further.
Please keep us updated on your post, and we hope you find a satisfactory solution to your query.
Regards,
Diana Torres,Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
Created 01-20-2025 02:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @enguias
Try using "modify-overwrite-beta" instead of the "modify-default-beta", it should work.
Created 01-28-2025 08:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@enguias Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.
Regards,
Diana Torres,Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
