Chicago / open-data-etl-utility-kit

Use Pentaho's open source data integration tool (Kettle) to create Extract-Transform-Load (ETL) processes to update a Socrata open data portal. Documentation is available at http://open-data-etl-utility-kit.readthedocs.io/en/stable
Other
95 stars 30 forks source link

Using 'result' as field name can result in email notification error #34

Closed tomschenkjr closed 8 years ago

tomschenkjr commented 8 years ago

In the image below, the "Get System Data" step creates a field called "result" which contains the result of the previous job entry in the job (KJB file) that called the ETL_Completion_E-Mail.ktr transformation file containing these steps. The "Set Subject and Body" step makes use of this result value.

If there was a field called "result" in the upstream transformation (KTR file) for the dataset update, itself, this appears to create a conflict and cause ETL_Completion_E-Mail.ktr to fail.

image

levyj commented 8 years ago

Example of the error from the Kettle log:

ERROR 08-03 13:51:27,757 - Set Subject and Body - Unexpected error ERROR 08-03 13:51:27,758 - Set Subject and Body - org.pentaho.di.core.exception.KettleValueException: Javascript error: ReferenceError: "result" is not defined. (script#4)

    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:458)
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:689)
    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50)
    at java.lang.Thread.run(Thread.java:722)

Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "result" is not defined. (script#4) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763) at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3848) at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1781) at org.mozilla.javascript.gen.script_7._c_script_0(script:4) at org.mozilla.javascript.gen.script_7.call(script) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178) at org.mozilla.javascript.gen.script_7.call(script) at org.mozilla.javascript.gen.script_7.exec(script) at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:377) ... 3 more

levyj commented 8 years ago

Testing a fix internally. If it works, I will add it to this project.