How to delete header attribute in JavaScript Evaluator

  • 28 April 2022
  • 0 replies
  • 115 views

Userlevel 4
Badge
  • StreamSets Employee
  • 96 replies

You can use the JavaScript Evaluator processor to read, update, or create record header attributes.

Use a map when creating or updating a header attribute. If a header attribute exists, the script updates the value. If it does not exist, the script creates the attribute and sets it to the specified value.

 

However, when it comes to delete due to the underlying Java interpretation (Nashorn engine API) and hence you need to use  Map API within Nashorn  to delete/remove elements.

 

i.e

records[i].attributes.remove('delete_this_attribute')

 

 


0 replies

Be the first to reply!

Reply