Skip to main content

How to delete header attribute in JavaScript Evaluator

  • April 28, 2022
  • 0 replies
  • 152 views

Rishi
StreamSets Employee
Forum|alt.badge.img

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')