apache / hop

Hop Orchestration Platform
https://hop.apache.org/
Apache License 2.0
940 stars 344 forks source link

[Bug]: Formula transform doesn't allow to re-use fields that were created in earlier formula lines in the same transform #3239

Closed bamaer closed 10 months ago

bamaer commented 1 year ago

Apache Hop version?

SNAPSHOT-2023-0919

Java version?

11.0.20.1

Operating system

Linux

What happened?

a formula that uses a field that was created in an earlier formula in the same transform throws an error:

2023/09/19 14:09:14 - re-use formula field.0 - ERROR: Unexpected error
2023/09/19 14:09:14 - re-use formula field.0 - ERROR: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 12
2023/09/19 14:09:14 - re-use formula field.0 -  at org.apache.hop.pipeline.transforms.formula.util.FormulaParser.getFormulaValue(FormulaParser.java:79)
2023/09/19 14:09:14 - re-use formula field.0 -  at org.apache.hop.pipeline.transforms.formula.Formula.processRow(Formula.java:124)
2023/09/19 14:09:14 - re-use formula field.0 -  at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55)
2023/09/19 14:09:14 - re-use formula field.0 -  at java.base/java.lang.Thread.run(Thread.java:829)
[formula-reuse-field.hpl.zip](https://github.com/apache/hop/files/12659757/formula-reuse-field.hpl.zip)

formula-reuse-field.hpl.zip

Issue Priority

Priority: 2

Issue Component

Component: Transforms

sramazzina commented 10 months ago

@hansva maybe this issue can be closed?