Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bamaer opened this issue Sep 19, 2023 · 1 comment · Fixed by #3251
Labels
bug P2 Default Priority Transforms
Milestone

Comments

@bamaer
Copy link
Contributor

bamaer commented Sep 19, 2023

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

@github-actions github-actions bot added P2 Default Priority Transforms labels Sep 19, 2023
hansva added a commit that referenced this issue Sep 23, 2023
allow formula transform to use fields created in previous transforms.… #3239
@bamaer bamaer reopened this Sep 26, 2023
bamaer added a commit to bamaer/hop that referenced this issue Sep 28, 2023
hansva added a commit that referenced this issue Sep 29, 2023
fixes to allow nested formulas on previously replaced fields #3239
@sramazzina
Copy link
Contributor

@hansva maybe this issue can be closed?

@bamaer bamaer added this to the 2.7 milestone Nov 23, 2023
@bamaer bamaer closed this as completed Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P2 Default Priority Transforms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants