StreamSets

StreamSets

Connect with experts and peers to elevate technical expertise, solve problems and share insights.

 View Only

How to delete header attribute in JavaScript Evaluator

  • 1.  How to delete header attribute in JavaScript Evaluator

    Posted Thu April 28, 2022 06:38 AM

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