I believe the root cause here is likely that NiFi has some limits in how accurately it can store numeric data types internally.
If you do not want to lose precesion, the best course of action is likely to indeed use a string under the hood.
I know an improvement is requested in this area to allow for greater numeric precision, but at this time I do not know the status of this.
---
Alternately, if I read your question the wrong way: The solution might also be to explicitly define the column type in Hive before writing, to avoid landing on string where it is not needed.
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.