apache / hop

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

[Bug]: Injecting constant values only not working for Select Value transformation #2986

Open dkuehn85 opened 1 year ago

dkuehn85 commented 1 year ago

Apache Hop version?

2.5.0

Java version?

17.0.7.7

Operating system

Windows

What happened?

I am trying to inject only two constant values from a parent pipeline into a "select values" transformation in a child pipeline. bug_MDI_select_value.zip

When runnning the parent pipeline, an error is thrown. 2023/06/02 10:07:26 - column select.0 - ERROR: At least one of select, remove or meta screens should contain data. 2023/06/02 10:07:26 - column select.0 - ERROR: Error initializing transform [column select] 2023/06/02 10:07:26 - bug_MDI_select_value_child - ERROR: Transform [column select.0] failed to initialize! 2023/06/02 10:07:26 - ETL metadata injection.0 - ERROR: Unexpected error 2023/06/02 10:07:26 - ETL metadata injection.0 - ERROR: org.apache.hop.core.exception.HopException: 2023/06/02 10:07:26 - ETL metadata injection.0 - We failed to initialize at least one transform. Execution can not begin! 2023/06/02 10:07:26 - ETL metadata injection.0 - 2023/06/02 10:07:26 - ETL metadata injection.0 - 2023/06/02 10:07:26 - ETL metadata injection.0 - at org.apache.hop.pipeline.Pipeline.prepareExecution(Pipeline.java:1089) 2023/06/02 10:07:26 - ETL metadata injection.0 - at org.apache.hop.pipeline.engines.local.LocalPipelineEngine.prepareExecution(LocalPipelineEngine.java:236) 2023/06/02 10:07:26 - ETL metadata injection.0 - at org.apache.hop.pipeline.transforms.metainject.MetaInject.processRow(MetaInject.java:172) 2023/06/02 10:07:26 - ETL metadata injection.0 - at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55) 2023/06/02 10:07:26 - ETL metadata injection.0 - at java.base/java.lang.Thread.run(Thread.java:833) 2023/06/02 10:07:26 - ETL metadata injection.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1) 2023/06/02 10:07:26 - bug_MDI_select_value_parent - Pipeline duration : 0.156 seconds [ 0.156" ] 2023/06/02 10:07:26 - bug_MDI_select_value_parent - Execution finished on a local pipeline engine with run configuration 'local' 2023/06/02 10:07:26 - bug_MDI_select_value_parent - Pipeline detected one or more transforms with errors. 2023/06/02 10:07:26 - bug_MDI_select_value_parent - Pipeline is killing the other transforms!

Issue Priority

Priority: 2

Issue Component

Component: Transforms

dkuehn85 commented 1 year ago

The bug is still present in the stable version 2.5.0

mattcasters commented 1 year ago

If you think about it, this is an incorrect usage of the constant values. It would only make sense for lists of exactly one constant value. That's why this was written in the documentation:

When specifying constant values for grouped lists of values like fields or filenames please note that there isn’t a good solution for that. Best practice is to use a [Data Grid](https://hop.apache.org//manual/latest/pipeline/transforms/datagrid.html) transform to inject a complete set of constant values. You can map those in this metadata injection transform. It will do its best to accommodate you by allowing you to inject a single row in the group with the specified constant value.

The way to solve this bug is then to throw an error I think, when incorrect/dangerous usage of the values is made.