Joaopolo commented on issue #8243:
URL: https://github.com/apache/hop/issues/8243#issuecomment-5515883912
I considered using the Java Filter, but I do not think it can handle this
particular case because the input schema itself is dynamic.
The table name is received at runtime, and the pipeline executes a query
such as:
SELECT *
FROM ${TABLE_NAME}
Therefore, the fields available in the stream depend on the table selected
at runtime. Some tables contain the GRUPO field, while others do not.
A Java Filter would work if GRUPO were already known to exist in the
incoming metadata. However, if the expression references GRUPO and the selected
table does not contain that field, the filter cannot simply evaluate the
condition as false, because the field is not part of the row metadata at all.
A fixed mapping has the same limitation: in some cases there is no source
field to map. There is also no predefined variable indicating whether GRUPO
exists. The pipeline obtains this information dynamically from the database
metadata returned by a query.
What I am looking for is conceptually similar to #6552, although it does not
necessarily need to be implemented in that same transform: an IF/ELSE mechanism
capable of inspecting the runtime row metadata and evaluating something like:
fieldExists("GRUPO")
It could then route the stream through the true or false path without
requiring GRUPO to be declared or known beforehand.
This is similar to the n8n IF node, which can check whether a property
exists in an incoming item even when the item structure was not defined during
workflow design.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]