0

I have a task in Apache NiFi

Table 1

ID date client_name attr_client

Table 2

ID date address city active

Table 3 (result table)

ID date client_name attr_client address city

I need to make a query to one database (one connection), then a query to another database (second connection) and combine data (on id and date field) into one file and save it to db. Is this possible?

I know about ExecuteSQL processor and can extract data, but I also should wait two files and then join them. Also I read about LookupRecord but it can't join data on two or more columns?

1
  • 1
    i would take table1 and execute inserts into a target db, then table2 and execute updates against the target db, then do the same with table3. of cause some fields should be nullable in your target db or defaulted to some values. or do all that against the staging table and then after you inserted all data into a staging table - as a last step move it from staging into a real table. Commented Jun 27, 2025 at 13:22

1 Answer 1

3

Take a look at LookupRecord and DatabaseRecordLookupService, you can use the latter on a single column (like id) to enrich the data (like a join on a single column). If you need to filter after that you can use QueryRecord to match the date with a SQL query, or perhaps first another LookupRecord for date then the QueryRecord to filter the results as needed.

answered Jun 30, 2025 at 20:35
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.