consume
Consumes all remaining output on the specified input if the expression evaluates to true.
Used in the following format, where input
may be an integer or a string that identifies the input to operate on and expr
is an expression that evaluates to a Boolean that determines whether or not to perform the consume:
consume(input, expr)
input.consume(expr)
The return value type is the same as the parameter.
field
Returns the value of the field name specified for the current row of data.
Used in the following format, where input
must be a string or integer and name
must be a string which may contain a numeric value:
field("[input:]name")
Examples
Returns the value of the field on the first input pin with the specified name
"type
".
theField = "1:type"x = field(theField)emit x
This example could also be written without the optional "input" element, as follows:
theField = "type"x = field(theField)emit x
If the "name" element is a string that contains a numeric value, it is interpreted as the field that has an index value that matches the value specified in the property, as in the following example:
If the input data contains five input fields, the following example would return the value of the third input field:
theField = "1:3"x = field(theField)emit x
This example could also be written without the optional input
property element, as follows:
theField = "3"x = field(theField)emit x
name
is numeric, rather than a string, the node run will fail. The following example will fail:theField = 3x = field(theField)emit x
fieldType
Returns the type code (see typeName) of the field name specified.
Used in the following format, where input
must be a string or integer and name
must be a string:
fieldType("[input:]name")
Examples
fldType=typeName(fieldType("IntFieldName")) # returns "integer"
inputFields
Returns a list of all fields on the specified input.
Used in the following format, where input
must be a string or integer and name
must be a string:
inputFields(input)
input.inputFields()
The return value type is a list of strings.
Examples
inputFields("in1") # {"name" "age" "tn" } for input with those three fields
"in1".inputFields() # {"name" "age" "tn" } for input with those three fields
numFields
Evaluates to the number of fields in the specified input. The input may be specified by name or by number (one-indexed). If the node only has one input, this parameter is optional. Ignores the parameter if it is null (the node must have only one input).
Used in the following format, where input-name
must be a string and input-num
must be an integer or long integer:
numFields([input-name|input-num])
[input-name|input-num].numFields()
The return value type is an integer.
Examples
numFields(1) # use input number
1.numFields() # use input number
numFields("primary input") # use input name
"primary input".numFields() # use input name
numInputs
Returns the number of inputs for a node.
Used in the following format:
numInputs()
The return value type is an integer.
Examples
numInputs() # 2
recordNumber
Returns the record number of the record under evaluation for a specified input. The returned record number is 1 based. The input may be specified by name or by number (one-indexed). If the node only has one input, this parameter is optional. Ignores the parameter if it is null (the node must have only one input).
Used in the following format, where input-name
must be a string and input-num
must be an integer or long integer:
recordNumber([input-name|input-num])
[input-name|input-num].recordNumber()
The return value type is an integer.
Examples
recordNumber(1) # use input number
1.recordNumber() # use input number
recordNumber("primary input") # use input name
"primary input".recordNumber() # use input name
requireField
Will error if the referenced input fields do not exist.
Used in the following format, where input
must be a string or integer and name
must be a string:
requireField("[input:]name" ...)