expr
must contain an arithmetic or relational expression (or combination thereof) based on the fields in the KDR
input and/or constant values.
Syntax: "<KDR.type>" : "<expression>"
The functions and operators that you can use in expressions are described below.
Conditional functions:
isSet(<field>)
- Returns 1 if the field is set to a value, otherwise 0isNotSet(<field>)
- Returns 1 if the field is not set to a value, otherwise 0
Operators:
+
- Addition-
- Subtraction/negation*
- Multiplication/
- Division
Relational operators:
=
- Equal!=
- Not equal>
- Greater than<
- Less than
A relational expression or sub-expression evaluates to 1 if it is true, or 0 if it is false.
You can use parentheses to modify the order of the operations, i e apply precedence rules.
Info |
---|
title | Example. Expressions |
---|
|
Arithmetic expression: Code Block |
---|
| "expr": {
"kdr_record_type_a": "field2-field1",
"kdr_record_type_b": "field3"
} |
Expression using conditional function: Code Block |
---|
| "expr": {
"kdr_record_type_a": "isSet(field1)"
} |
Relational expression: Code Block |
---|
| "expr": {
"kdr_record_type_a": "field2<(field1+10)"
} |
|
In case of division by zero, the value of the output of the expression will be positive infinity, negative infinity, or NaN (Not a Number) as defined in the JVM specification.