Forum Discussion
That's very helpful for me. Thank you so much ❤️
A document should not be modified once it has been written to the output view. Making a copy of the document avoids issues. Change the loop to create a new wrapper Map
for item in sourceTables: wrapper = java.util.HashMap(in_doc) wrapper['query'] = "update iods_staging.{} set record_inserted = true;".format(item) self.output.write(wrapper)
- aditya_sharma8 years agoNew Contributor III
Hi Akidave,
Thanks you so much for your solution. However, I would really appreciate if you could explain me more why we should not modify the document once it has been written to the output view.
Thanks again.
Aditya
- aditya_sharma8 years agoNew Contributor III
Hi Dmiller,
Please find below output from script snap and mapper output. Mapper output has two update statements same which is incorrect, it has to be same like script.
Script Snap:
“query”: “update iods_staging.stg_sf_account_dim_institution set record_inserted = true;”
“query”: “update iods_staging.stg_sf_accountdistict_dim_institution set record_inserted = true;”
“query”: “update iods_staging.stg_sf_recordtype_dim_institution set record_inserted = true;”Mapper Output:
“query”
“update iods_staging.stg_sf_account_dim_institution set record_inserted = true;”
“update iods_staging.stg_sf_recordtype_dim_institution set record_inserted = true;”
“update iods_staging.stg_sf_recordtype_dim_institution set record_inserted = true;”Thanks
Aditya