leehaut opened a new pull request, #8431:
URL: https://github.com/apache/hop/pull/8431

   Fix https://github.com/apache/hop/issues/8283
   
   ## Summary
   Clicking **SQL** on Combination Lookup throws:
   
   ```text
   java.lang.NullPointerException: Cannot invoke 
"...PipelineMeta.findDatabase(...)"
   because the return value of "...TransformMeta.getParentPipelineMeta()" is 
null
       at CombinationLookupMeta.getSqlStatements(...:425)
       at CombinationLookupDialog.create(...:900)
   ```
   
   The dialog builds a **temporary** meta and wraps it in a new 
`TransformMeta`. That wrapper never gets a parent pipeline. `getSqlStatements` 
and `analyseImpact` ignored the `pipelineMeta` argument and looked up the 
connection through:
   
   ```java
   getParentTransformMeta().getParentPipelineMeta().findDatabase(...)
   ```
   
   ## Change
   
   Use the `pipelineMeta` passed into those methods, matching Dimension Lookup:
   
   ```java
   DatabaseMeta databaseMeta = pipelineMeta.findDatabase(connectionName, 
variables);
   ```
   
   - `analyseImpact` returns early when the connection or input row meta is 
missing, so a missing connection does not become a second NPE.
   - `KeyField` and `ReturnFields` getters/setters are replaced with Lombok.
   
   
   ## Test plan
   
   - [x] Unit tests in `CombinationLookupMetaTest` cover the dialog path 
(parent pipeline is `null`):
     - missing connection
     - connection resolved from `pipelineMeta`
     - missing input fields
     - `analyseImpact`
   - [x] `CombinationLookupMetaTest` + `CombinationLookupLineageTest` (9 tests)
   - [x] Hop Gui: open Combination Lookup with a connection, table, and 
incoming key fields, then click **SQL**
     - **Expected:** SQL editor, “no SQL needed”, or a normal connection error
     - **Not expected:** this `getParentPipelineMeta()` NPE


-- 
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]

Reply via email to