Back to Yugabyte Db

Operators [YCQL]

docs/content/v2.20/api/ycql/expr_ocall.md

2026.1.0.0-b251.7 KB
Original Source

An expression with operators is a compound expression that combines multiple expressions using built-in operators. The following sections discuss the YCQL operators in YugabyteDB.

Null operators

OperatorDescription
EXISTS, NOT EXISTSpredicate for existence of a row

EXISTS and NOT EXISTS can only be used in the IF clause.

Unary operators

OperatorDescription
-numeric negation
+no-op
NOTLogical (boolean) negation

Unary - and + can only be used with constant expressions such as -77.

Binary operators

OperatorDescription
OR, ANDLogical (boolean) expression
=, !=, <, <=, >, >=Comparison expression
+Addition, append, or prepend
-Subtraction or removal
*Multiplication. Not yet supported
/Division. Not yet supported
ISNULL, IS NOT NULLNot yet supported comparison expression.
  • The first argument of comparison operators must be a column. For example, column_name = 7.
  • Comparing NULL with others always yields a false value. Operator ISNULL or IS NULL must be used when comparing with NULL.
  • When + and - are applied to a NULL argument of COUNTER data type, the NULL expression is replaced with a zero value before the computation. When these operators are applied to a NULL expression of all other numeric data types, the computed value is always NULL.
  • Operator + either prepends or appends a value to a LIST while operator - removes elements from LIST.
  • Operator + inserts new distinct elements to a MAP or SET while operator - removes elements from them.