[Bug]: Formula returns 0.0 instead of null for string type
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 476
- Avg merge
- 19h
- Merged PRs (30d)
- 227
Description
### Apache Hop version?
2.12
### Java version?
17
### Operating system
Windows
### What happened?
I recently discovered a weird behaviour in the formula transform.

If you look at the image, given the formula, NEW_FIELD should be null instead of "0.0".
If I select just one of the IDs though, then NEW_FIELD is correctly assigned null.

I have the same behaviour on both Hop 2.8 on Java 11 and Hop 2.12 on Java 17.
Thanks!
### Issue Priority
Priority: 2
### Issue Component
Component: Transforms
Contributor guide
Research direction
Start with the formula transform and reproduce the reported case on the listed Hop and Java versions, using the screenshots as the expected behavior reference. Investigate why the formula produces 0.0 when multiple IDs are selected but null when one ID is selected. Done means the affected expression returns null consistently for the string-type case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100