{"record":{"id":"e9bff61355507be5","repo":"pentaho/pentaho-kettle","slug":"the-function-call-getinputrowmeta-doesn-t-require-arguments","errorCode":null,"errorMessage":"The function call getInputRowMeta doesn't require arguments.","messagePattern":"The function call getInputRowMeta doesn't require arguments\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java","lineNumber":1897,"sourceCode":"  // Return the input row metadata\n  public static RowMetaInterface getInputRowMeta( ScriptEngine actualContext, Bindings actualObject,\n    Object[] ArgList, Object FunctionContext ) {\n    if ( ArgList.length == 0 ) {\n      try {\n        Object scmO = actualObject.get( \"_step_\" );\n        try {\n          Script scm = (Script) scmO;\n          return scm.getInputRowMeta();\n        } catch ( Exception e ) {\n          ScriptDummy scm = (ScriptDummy) scmO;\n          return scm.getInputRowMeta();\n        }\n      } catch ( Exception e ) {\n        throw new RuntimeException( \"Unable to get the input row metadata because of an error: \"\n          + Const.CR + e.toString() );\n      }\n    } else {\n      throw new RuntimeException( \"The function call getInputRowMeta doesn't require arguments.\" );\n    }\n  }\n\n  // Return the input row metadata\n  public static Object[] createRowCopy( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList,\n    Object FunctionContext ) {\n    if ( ArgList.length == 1 ) {\n      try {\n        int newSize = (int) Math.round( (Double) ArgList[0] );\n\n        Object scmO = actualObject.get( \"row\" );\n        Object[] row = (Object[]) scmO; // TODO AKRETION ensure\n\n        return RowDataUtil.createResizedCopy( row, newSize );\n      } catch ( Exception e ) {\n        throw new RuntimeException( \"Unable to create a row copy: \" + Const.CR + e.toString() );\n      }\n    } else {","sourceCodeStart":1879,"sourceCodeEnd":1915,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/script/ScriptAddedFunctions.java#L1879-L1915","documentation":"Argument-count guard in ScriptAddedFunctions for the getInputRowMeta added function. getInputRowMeta() takes no parameters; if the script passes any arguments the wrapper throws this RuntimeException instead of silently ignoring them.","triggerScenarios":"Calling getInputRowMeta(...) with one or more arguments inside a Script transform script, e.g. getInputRowMeta(someField) or getInputRowMeta(null).","commonSituations":"Confusing getInputRowMeta() with functions that do take arguments (like createRowCopy(size)), or copy-pasted script code where the author assumed a parameter selects a field.","solutions":["Call getInputRowMeta() with an empty argument list: getInputRowMeta().","If you intended to fetch a specific field, get the RowMeta via getInputRowMeta() and then look up the field from it.","Search the script for getInputRowMeta( and remove any arguments passed."],"exampleFix":"// before\nvar meta = getInputRowMeta(0);\n// after\nvar meta = getInputRowMeta();","handlingStrategy":"validation","validationCode":"if (arguments.length !== 0) throw new Error('getInputRowMeta takes no arguments');","typeGuard":null,"tryCatchPattern":"try { var meta = getInputRowMeta(); } catch (e) { if (String(e).indexOf('doesn\\'t require arguments') !== -1) { /* fix call site: remove args */ } throw e; }","preventionTips":["Grep scripts for getInputRowMeta( and verify empty parens","Don't confuse with createRowCopy(size), which takes one argument"],"tags":["pdi","kettle","script","argument-count","runtime"],"backgroundTag":"missing-required-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}