Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 05-30-2018 02:23 PM
I am trying to write NiFi expression for routeonattribute processor as below:
${db.table.schema:toLower():in(${IncludeSchemaList}):and(${db.table.name:toLower():in(${ExcludeTableList}):not()})}
IncludeSchemaList and ExcludeTableList are provided in variables and added onto the flowfile as an attribute with updateattribute processor. The above In clause is treating the variables as literals and not working.
If I hard code the variables it looks like this:
${db.table.schema:toLower():in("dbo","hilton","archive","audit", "util"):and(${db.table.name:toLower():in("couponcodes","batch_job_execution_context","batch_step_execution"):not()})}
I hope someone knows how to solve for this. I would like to parameterize the schemanames to include and tables names to exclude in variables.
Thanks.
Created 05-30-2018 06:03 PM
@Prachi Sharma I think you should try something like this:
${anyDelineatedValue("${IncludeSchemaList}", ","):equals("${db.table.schema}"):and(anyDelineatedValue("${ExcludeTableList}", ","):equals("${db.table.schema}"):not())}while having
IncludeSchemaList=dbo,hilton,archive,audit,util ExcludeTableList=couponcodes,batch_job_execution_context,batch_step_execution
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 05-30-2018 06:03 PM
@Prachi Sharma I think you should try something like this:
${anyDelineatedValue("${IncludeSchemaList}", ","):equals("${db.table.schema}"):and(anyDelineatedValue("${ExcludeTableList}", ","):equals("${db.table.schema}"):not())}while having
IncludeSchemaList=dbo,hilton,archive,audit,util ExcludeTableList=couponcodes,batch_job_execution_context,batch_step_execution
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 05-30-2018 08:35 PM
Thanks, I appreciate the quick response. I had to tweak the approach a bit, but this worked great!
I used two routeonattribute processor as the not() was posing issues.
First apply schema filter allows matches to flow through using below:
${anyDelineatedValue("${IncludeSchemaList}", ","):equalsIgnoreCase("${db.table.schema}")}Then I apply table filter and only allow unmatched to flow through, using below:
${anyDelineatedValue("${ExcludeTableList}", ","):equalsIgnoreCase("${db.table.name}")}