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]: "Show input fields" on a transform shows a field that is NOT available in the stream #4876

Open
gmitter-ef opened this issue Feb 7, 2025 · 2 comments

Comments

@gmitter-ef
Copy link

gmitter-ef commented Feb 7, 2025

Apache Hop version?

2.11.0

Java version?

OpenJDK 17

Operating system

Windows

What happened?

See the attachments. Basis is samples/transforms/json-input-basic.hpl.

Bug shows in version json-input-basic_2.hpl (see attached):
4876.zip

  • open json-input-basic.hpl from samples/transforms
  • Add a parameter to the pipeline "param1" with default value "test"
  • Add a "Get variables" transform to read it into the stream at the beginning
  • Add a "Write to log" tansform at the end, include all available fields (including param1)
  • try to run the pipeline ==> error "Cannot find field [param1] in the input stream!"
    ** kind of plausible, as probably JSON input transform that reads a FILE should be the first transform in a pipeline
  • click on "Show input fields" of the "Write to log" transform: param1 shows up! This should NOT be the case in my opinion and is totally confusing.

json-input-basic_3.hpl: when reading the json from a field, everything workxs
json-input-basic_4.hpl: when doing the "Get variables" transform AFTER the json input, it also works

Issue Priority

Priority: 3

Issue Component

Component: Hop Gui, Component: Transforms

@shlxue
Copy link
Contributor

shlxue commented Feb 12, 2025

I checked this hpl: this is a bug of JSON Input transform. If don't use previous fields as Json file source: Ignore all input fields.

In fact, I am more concerned about another issue:
What's is the input transforms?
The default behavior of a new data stream initiator should be to ignore all previous fields.

Is the rule allowed to be broken? Like JSON input transform: pass previous fields to downstream

@hansva
Copy link
Contributor

hansva commented Feb 12, 2025

You are right that most input transforms do not pass previous data, but I am not sure it is a hard rule at the moment...
However, it is confusing that some do and some don't, especially if the metadata makes you think it does.

We might have to take a look and see which do and which don't and align and or document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants