Support Questions

Find answers, ask questions, and share your expertise

How can i add multiple TableNamePattern in ListDatabseTable processor in NiFi (HDF) ?

avatar
Contributor

I have around 400 tables in a SQL server database, out of which i want to list 10 tables from ListDatabaseTables processor in Apache NiFi in HDF. These 10 tables doesn't have a fix naming pattern.

When i am trying to add multiple tables with semicolon as separation in value of TableNamePattern property, the processor is not able to detect the tables. While the same works absolutely fine with single TableNamePattern value.

Refer to screen shots:

1st processors works fine whereas 2nd processor is not able to search the tables.

Any other suggestion to import data from 10 tables(not having a fix naming pattern) out of 400-500 tables through NiFi will be highly appreciated.

12686-13.png

12687-14.png

1 REPLY 1

avatar
Master Guru

Hi @Praveen Singh,i got other solution for your case.

1. The results from ListDatabaseTables processor will have individual flowfiles with db.table.name, db.table.fullname attributes associated with each flow file.

2. You can take advantage of either of those attributes in RouteonAttribute processor by using the property as follows...

${db.table.name:in("tablename1","tablename2",.....,"tablename10")}

and mention the list of required table names in the expression to filter out the required table names from the results of ListDatabaseTables processor.

Flow screenshot:-

38580-flow-required-tables.png

RouteonAttribute configs:-

38581-routeonattribute-config.png