Comparison expressions
You can use the following operators in comparison expressions:
- = or == for "equal to"
- != for "not equal to"
- < for "less than"
- <= for "less than or equal to"
- > for "greater than"
- >= for "greater than or equal to"
Strings and bytes can be converted to numeric types when they are compared to numeric types. For example, in "1" < 2, "1" is converted to an integer to perform the comparison. If the string cannot be converted to a numeric type, an exception is raised.
If one of the values is missing, the expression returns an exception, except in Talend Data Mapper where it returns false.
If you compare a Boolean to a string, the string "true", regardless of its case, is interpreted as true, and other strings are interpreted as false.
The following examples are valid comparison expressions that return
true:
2 < "3"
"200" >= 100
2 == "2"
"true" == true
0x0A == 10
"5e+2" == 500