You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@hop.apache.org by "avinuez (via GitHub)" <gi...@apache.org> on 2025/04/21 20:22:47 UTC

[D] Help with metadata injection for incremental Load (hop)

GitHub user avinuez created a discussion: Help with metadata injection for incremental Load

Hi, I got 46 tables to be loaded, they all with a pipeline template:
![image](https://github.com/user-attachments/assets/8b61a26e-a771-49d7-b92e-02c78fcff85f)
As you can see, it's about to compare old and new data and perform updates if there is a change or new input rows.

The 46 tables need to run this pipeline with MDI, so I created a parent pipeline:
![image](https://github.com/user-attachments/assets/61bc1651-ab07-4737-8b33-42c0687be27b)

the parameters table is `metadata config`. This tables structure is:

![image](https://github.com/user-attachments/assets/7e18c3e0-7f50-4b43-8eb0-3f28e94f2a73)

**How the pipeline should work:**
For each of 46 rows, the MDI transform injects de row params to execute the pipeline template. For each row injected it has to inject the field names (defined as queries in **select_column_names** field) to be used in `merge rows(diff)` and `insert/update` transforms. So it executes every query to get those table colulumn names as every row from `metadata config` table is injected.

`metadata config` looks like this:
![image](https://github.com/user-attachments/assets/e912ed3b-df57-44f2-9ea4-76eea3f2dca1)
![image](https://github.com/user-attachments/assets/ff394a97-720d-4bc5-add0-bbff027f763c)
![image](https://github.com/user-attachments/assets/d03fe777-8e78-4279-93b0-f27266029cc5)

### With a limit of 1 row for the `metadata config` parameters-table, the metadata injection performs well, even the output pipeline file is generated correctly with its parameters, but for the 46 rows, I got this error:
2025/04/21 15:06:50 - Hop - Pipeline opened.
2025/04/21 15:06:50 - Hop - Launching pipeline [etl_load_tables]...
2025/04/21 15:06:50 - Hop - Started the pipeline execution.
2025/04/21 15:06:50 - etl_load_tables - Executing this pipeline using the Local Pipeline Engine with run configuration 'local'
2025/04/21 15:06:50 - etl_load_tables - Execution started for pipeline [etl_load_tables]
2025/04/21 15:06:50 - metadata config.0 - Finished reading query, closing connection.
2025/04/21 15:06:50 - metadata config.0 - Finished processing (I=3, O=0, R=0, W=6, U=0, E=0)
2025/04/21 15:06:50 - Dynamic SQL row.0 - Finished processing (I=102, O=0, R=3, W=99, U=0, E=0)
2025/04/21 15:06:50 - incremental_load - Executing this pipeline using the Local Pipeline Engine with run configuration 'local'
2025/04/21 15:06:50 - incremental_load - Execution started for pipeline [incremental_load]
2025/04/21 15:06:58 - ETL Table input.0 - Finished reading query, closing connection.
2025/04/21 15:06:58 - ETL Table input.0 - Finished processing (I=309089, O=0, R=0, W=309089, U=0, E=0)
2025/04/21 15:07:01 - ERP Table input.0 - Finished reading query, closing connection.
2025/04/21 15:07:01 - ERP Table input.0 - Finished processing (I=309080, O=0, R=0, W=309080, U=0, E=0)
2025/04/21 15:07:01 - Merge rows (diff).0 - ERROR: Unable to find field [orden] in reference stream.
2025/04/21 15:07:01 - Merge rows (diff).0 - ERROR: Unexpected error
2025/04/21 15:07:01 - Merge rows (diff).0 - ERROR: org.apache.hop.core.exception.HopTransformException: 
2025/04/21 15:07:01 - Merge rows (diff).0 - Unable to find field [orden] in reference stream.
2025/04/21 15:07:01 - Merge rows (diff).0 - 
2025/04/21 15:07:01 - Merge rows (diff).0 - 	at org.apache.hop.pipeline.transforms.mergerows.MergeRows.processRow(MergeRows.java:110)
2025/04/21 15:07:01 - Merge rows (diff).0 - 	at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:54)
2025/04/21 15:07:01 - Merge rows (diff).0 - 	at java.base/java.lang.Thread.run(Thread.java:1583)
2025/04/21 15:07:01 - Merge rows (diff).0 - Finished processing (I=0, O=0, R=2, W=0, U=0, E=1)
2025/04/21 15:07:01 - Sort rows.0 - Finished processing (I=0, O=0, R=309080, W=9159, U=0, E=0)
2025/04/21 15:07:01 - incremental_load - Pipeline detected one or more transforms with errors.
2025/04/21 15:07:01 - incremental_load - Pipeline is killing the other transforms!
2025/04/21 15:07:01 - Sort rows 2.0 - Finished processing (I=0, O=0, R=309089, W=10002, U=0, E=0)
2025/04/21 15:07:01 - incremental_load - Pipeline duration : 10.455 seconds [ 10.455" ]
2025/04/21 15:07:01 - incremental_load - Execution finished on a local pipeline engine with run configuration 'local'
2025/04/21 15:07:01 - ETL injection.0 - Finished processing (I=309089, O=0, R=309089, W=309089, U=0, E=1)
2025/04/21 15:07:01 - etl_load_tables - Pipeline duration : 10.922 seconds [ 10.922" ]
2025/04/21 15:07:01 - etl_load_tables - Execution finished on a local pipeline engine with run configuration 'local'
2025/04/21 15:07:01 - etl_load_tables - Pipeline detected one or more transforms with errors.
2025/04/21 15:07:01 - etl_load_tables - Pipeline is killing the other transforms!

I suspect it's because the transform `Dynamic SQL row` generates cummulative rows for the filed_names of each table, so the pipeline template maps all those fields and not the only needed. What should I do?

I would appreciate any help for this, I'm new at apache hop. Thanks in advance.


GitHub link: https://github.com/apache/hop/discussions/5208

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Help with metadata injection for incremental Load (hop)

Posted by "bamaer (via GitHub)" <gi...@apache.org>.
GitHub user bamaer added a comment to the discussion: Help with metadata injection for incremental Load

you'll probably have to build a loop that provides the full set of metadata details for each of the 46 rows, but not all of those details in one go. Have a look at the [loops guide](https://hop.apache.org/manual/latest/how-to-guides/loops-in-apache-hop.html) in the docs, and use the `optional target file (hpl after injection)` and uncheck the `run resulting pipeline` options to generate the injected pipeline without executing it to troubleshoot the 46 pipelines you need to run. 

GitHub link: https://github.com/apache/hop/discussions/5208#discussioncomment-12906063

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Help with metadata injection for incremental Load (hop)

Posted by "ggrohmann (via GitHub)" <gi...@apache.org>.
GitHub user ggrohmann edited a comment on the discussion: Help with metadata injection for incremental Load

I'm not quite sure, what the issue is, but sounds like you get too many fields like for the meta injection of the csv files (thus the step/ resulting pipeline is searching for fields in the file, that don't exist)?

A good way to remove a defined set of columns, but to keep all other columns in the stream, which you don't want to specify (as they change for every injected, created pipeline) is the "select values" step. 

The injection would somewhat look like this (one row for the file name, n rows for the fields)
![{A5F7D22A-8849-49FE-87B2-5F0D139AC34B}](https://github.com/user-attachments/assets/6271fbae-357d-4032-82b9-d127efae26c7)

Also, the metadata step creates new lines in the stream, in particular one row for each input column creates one row with meta information of this row (column type...)
Note, that the fields part contains the selected values step (the important part ist to tick the "Include unspecified fields"):
![{B48CE45A-776B-42AE-A44E-12769CF8F39E}](https://github.com/user-attachments/assets/fa4fe03b-9ee6-46a8-8485-cf6f281d4f56)
![{42B8DC09-80AD-4A9E-B2F4-BED86E150E63}](https://github.com/user-attachments/assets/43aeaeab-e8f9-4c1b-a6f3-1cbf92bec564)

Hope that helps

GitHub link: https://github.com/apache/hop/discussions/5208#discussioncomment-12907363

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Help with metadata injection for incremental Load (hop)

Posted by "ggrohmann (via GitHub)" <gi...@apache.org>.
GitHub user ggrohmann edited a comment on the discussion: Help with metadata injection for incremental Load

I'm not quite sure, what the issue is, but sounds like you get too many fields like for the meta injection of the csv files (thus the step/ resulting pipeline is searching for fields in the file, that don't exist)?

A good way to remove a defined set of columns, but to keep all other columns in the stream, which you don't want to specify (as they change for every injected, created pipeline) is the "select values" step. 

The injection would somewhat look like this (one row for the file name, n rows for the fields)
![{A5F7D22A-8849-49FE-87B2-5F0D139AC34B}](https://github.com/user-attachments/assets/6271fbae-357d-4032-82b9-d127efae26c7)

Note, that the fields part contains the selected values step (the important part ist to tick the "Include unspecified fields"):
![{B48CE45A-776B-42AE-A44E-12769CF8F39E}](https://github.com/user-attachments/assets/fa4fe03b-9ee6-46a8-8485-cf6f281d4f56)
![{42B8DC09-80AD-4A9E-B2F4-BED86E150E63}](https://github.com/user-attachments/assets/43aeaeab-e8f9-4c1b-a6f3-1cbf92bec564)

Hope that helps

GitHub link: https://github.com/apache/hop/discussions/5208#discussioncomment-12907363

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Help with metadata injection for incremental Load (hop)

Posted by "ggrohmann (via GitHub)" <gi...@apache.org>.
GitHub user ggrohmann edited a comment on the discussion: Help with metadata injection for incremental Load

I'm not quite sure, what the issue is, but sounds like you get too many fields like for the meta injection of the csv files (thus the step/ resulting pipeline is searching for fields in the file, that don't exist)?

A good way to remove a defined set of columns, but to keep all other columns in the stream, which you don't want to specify (as they change for every injected, created pipeline) is the "select values" step. 

The injection would somewhat look like this (one row for the file name, n rows for the fields)
![{A5F7D22A-8849-49FE-87B2-5F0D139AC34B}](https://github.com/user-attachments/assets/6271fbae-357d-4032-82b9-d127efae26c7)

Also, the csv metadata step creates new lines in the stream, in particular one row for each input column creates one row with meta information of this row (column type...)
Note, that the fields part contains the selected values step (the important part ist to tick the "Include unspecified fields"):
![{B48CE45A-776B-42AE-A44E-12769CF8F39E}](https://github.com/user-attachments/assets/fa4fe03b-9ee6-46a8-8485-cf6f281d4f56)
![{42B8DC09-80AD-4A9E-B2F4-BED86E150E63}](https://github.com/user-attachments/assets/43aeaeab-e8f9-4c1b-a6f3-1cbf92bec564)

Hope that helps

GitHub link: https://github.com/apache/hop/discussions/5208#discussioncomment-12907363

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Help with metadata injection for incremental Load (hop)

Posted by "ggrohmann (via GitHub)" <gi...@apache.org>.
GitHub user ggrohmann added a comment to the discussion: Help with metadata injection for incremental Load

I'm not quite sure, what the issue is, but sounds like you get too many fields for the meta injection of the csv files (thus the step/ resulting pipeline is searching for fields in the file, that don't exist)?

A good way to remove a defined set of columns, but to keep all other columns in the stream, which you don't want to specify (as they change for every injected, created pipeline) is the "select values" step. 

The injection would somewhat look like this (one row for the file name, n rows for the fields)
![{A5F7D22A-8849-49FE-87B2-5F0D139AC34B}](https://github.com/user-attachments/assets/6271fbae-357d-4032-82b9-d127efae26c7)

Note, that the fields part contains the selected values step (the important part ist to tick the "Include unspecified fields"):
![{B48CE45A-776B-42AE-A44E-12769CF8F39E}](https://github.com/user-attachments/assets/fa4fe03b-9ee6-46a8-8485-cf6f281d4f56)
![{42B8DC09-80AD-4A9E-B2F4-BED86E150E63}](https://github.com/user-attachments/assets/43aeaeab-e8f9-4c1b-a6f3-1cbf92bec564)

Hope that helps

GitHub link: https://github.com/apache/hop/discussions/5208#discussioncomment-12907363

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org