8.7.3 Coding rules for conditional expressions

This subsection discusses the coding rules for a conditional expression specified in the stream.filterCondition parameter.

Organization of this subsection
(1) Format of conditional expression
(2) Example of conditional expression
(3) Notes on conditional expressions

(1) Format of conditional expression

Specify a conditional expression in the following format:

'('column-name comparison-operator constant')'[{AND | OR}'('column-name comparison-operator constant')'
                         {AND | OR}'('column-name comparison-operator constant')'...]

To combine multiple comparison operations, use AND or OR to join the expressions. You can specify a maximum of ten expressions.

The following describes the elements of a conditional expression.

column-name
Specifies the name of the column that is to be subject to the comparison operation. This column name must be specified as a schema specification character string in the stream definition (register stream clause).
comparison-operator
Specifies the operator to be used in evaluating the condition. The table below lists and describes the comparison operators that can be specified.
Comparison operatorUsage exampleMeaning
<=A <= BA is equal to or less than B
>=A >= BA is equal to or greater than B
<A < BA is less than B
>A > BA is greater than B
=A = BA is equal to B
!=A != BA is not equal to B
constant
Specifies the value on which the comparison operation is to be performed, expressed as an integer constant or a character-string constant.
  • Integer constant
    If you use a numeric value for the comparison operation, specify an integer constant. The permitted value is an integer in the range from -9223372036854775808 to 9223372036854775807.
  • Character-string constant
    If you use a character string for the comparison operation, specify a character-string constant enclosed in single quotation marks ('). The permitted value is a string of single-byte and double-byte characters with a maximum length of 100 characters.

(2) Example of conditional expression

The following shows an example of a conditional expression:

stream.filterCondition=(xxx='abc')AND(zzz>18)AND(zzz<60)

This example retains only those tuples whose column xxx is abc and column zzz is greater than 18 and smaller than 60.

(3) Notes on conditional expressions