Expressions & Operators
Compare values and combine arithmetic and logical expressions.
Scalar Functions
| Function | Summary |
|---|---|
spql.add | Add two values. |
spql.and | Return the boolean conjunction of two values. |
spql.div | Divide the left value by the right value. |
spql.eq | Return whether two values are equal. |
spql.gt | Return whether the left value is greater than the right value. |
spql.gte | Return whether the left value is greater than or equal to the right value. |
spql.ilike | Return whether a UTF8 value matches a SQL ILIKE pattern. |
spql.is_null | Return whether a value is null. |
spql.isfinite | Test whether a floating-point value is finite. |
spql.isinf | Test whether a floating-point value is infinite. |
spql.isnan | Test whether a floating-point value is NaN. |
spql.like | Return whether a UTF8 value matches a SQL LIKE pattern. |
spql.lt | Return whether the left value is less than the right value. |
spql.lte | Return whether the left value is less than or equal to the right value. |
spql.mul | Multiply two values. |
spql.neq | Return whether two values are not equal. |
spql.not | Invert a boolean value. |
spql.not_ilike | Return whether a UTF8 value does not match a SQL ILIKE pattern. |
spql.not_like | Return whether a UTF8 value does not match a SQL LIKE pattern. |
spql.or | Return the boolean disjunction of two values. |
spql.sub | Subtract the right value from the left value. |
spql.add
Add two values.
- Kind:
scalar function - Volatility:
immutable
spql.add(left, right) -> u8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u8 | Left-hand value. |
right | yes | u8 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> i8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i8 | Left-hand value. |
right | yes | i8 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> u16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u16 | Left-hand value. |
right | yes | u16 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> i16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i16 | Left-hand value. |
right | yes | i16 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> u32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u32 | Left-hand value. |
right | yes | u32 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> i32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i32 | Left-hand value. |
right | yes | i32 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> u64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u64 | Left-hand value. |
right | yes | u64 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> i64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i64 | Left-hand value. |
right | yes | i64 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> f16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f16 | Left-hand value. |
right | yes | f16 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> f32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f32 | Left-hand value. |
right | yes | f32 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> f64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f64 | Left-hand value. |
right | yes | f64 | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
The sum as a value or expression.
spql.add(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Temporal overloads retain the date or timestamp type, unit and timezone. An Interval applies months first, clamping to the target month's last valid day, then calendar days, then elapsed nanoseconds. Subtraction negates each component and uses the same order. Month clamping is neither associative nor reversible.
Calendar components modify local fields and resolve their combined result once, rejecting repeated or skipped local times before applying elapsed nanoseconds. Zero calendar components preserve the input instant. A Duration is entirely elapsed time. Date results must be whole days; timestamp results must be exact in their retained unit. Null operands propagate null. Overflow and non-null intervals with null components fail.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | vortex.date | vortex.timestamp, spql.Interval | spql.Duration | Left-hand value. |
right | yes | spql.Interval | spql.Duration, vortex.date | vortex.timestamp | Right-hand value. |
Returns
The sum as a value or expression.
spql.and
Return the boolean conjunction of two values.
- Kind:
scalar function - Volatility:
immutable
spql.and(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | bool | Left-hand boolean value. |
right | yes | bool | Right-hand boolean value. |
Returns
A boolean value or expression.
spql.div
Divide the left value by the right value.
- Kind:
scalar function - Volatility:
immutable
spql.div(left, right) -> u8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u8 | Left-hand value. |
right | yes | u8 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> i8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i8 | Left-hand value. |
right | yes | i8 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> u16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u16 | Left-hand value. |
right | yes | u16 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> i16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i16 | Left-hand value. |
right | yes | i16 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> u32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u32 | Left-hand value. |
right | yes | u32 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> i32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i32 | Left-hand value. |
right | yes | i32 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> u64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u64 | Left-hand value. |
right | yes | u64 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> i64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i64 | Left-hand value. |
right | yes | i64 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> f16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f16 | Left-hand value. |
right | yes | f16 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> f32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f32 | Left-hand value. |
right | yes | f32 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> f64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f64 | Left-hand value. |
right | yes | f64 | Right-hand value. |
Returns
The quotient as a value or expression.
spql.div(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
The quotient as a value or expression.
spql.eq
Return whether two values are equal.
- Kind:
scalar function - Volatility:
immutable
spql.eq(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.gt
Return whether the left value is greater than the right value.
- Kind:
scalar function - Volatility:
immutable
spql.gt(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.gte
Return whether the left value is greater than or equal to the right value.
- Kind:
scalar function - Volatility:
immutable
spql.gte(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.ilike
Return whether a UTF8 value matches a SQL ILIKE pattern.
- Kind:
scalar function - Volatility:
immutable
spql.ilike(value, pattern) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Input UTF8 value. |
pattern | yes | utf8 | SQL pattern. |
Returns
A boolean value or expression.
spql.is_null
Return whether a value is null.
- Kind:
scalar function - Volatility:
immutable
spql.is_null(value) -> boolParameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | null? | Value to test for nullness. |
Returns
A boolean value or expression.
spql.is_null(value) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | T | Value to test for nullness. |
Returns
A boolean value or expression.
spql.isfinite
Test whether a floating-point value is finite.
- Kind:
scalar function - Volatility:
immutable
spql.isfinite(value) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f16, f32, f64 | Floating-point value to classify. |
Returns
true when the value is neither NaN nor infinite, otherwise false.
spql.isinf
Test whether a floating-point value is infinite.
- Kind:
scalar function - Volatility:
immutable
spql.isinf(value) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f16, f32, f64 | Floating-point value to classify. |
Returns
true when the value is positive or negative infinity, otherwise false.
spql.isnan
Test whether a floating-point value is NaN.
- Kind:
scalar function - Volatility:
immutable
spql.isnan(value) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f16, f32, f64 | Floating-point value to classify. |
Returns
true when the value is NaN, otherwise false.
spql.like
Return whether a UTF8 value matches a SQL LIKE pattern.
- Kind:
scalar function - Volatility:
immutable
spql.like(value, pattern) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Input UTF8 value. |
pattern | yes | utf8 | SQL pattern. |
Returns
A boolean value or expression.
spql.lt
Return whether the left value is less than the right value.
- Kind:
scalar function - Volatility:
immutable
spql.lt(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.lte
Return whether the left value is less than or equal to the right value.
- Kind:
scalar function - Volatility:
immutable
spql.lte(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.mul
Multiply two values.
- Kind:
scalar function - Volatility:
immutable
spql.mul(left, right) -> u8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u8 | Left-hand value. |
right | yes | u8 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> i8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i8 | Left-hand value. |
right | yes | i8 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> u16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u16 | Left-hand value. |
right | yes | u16 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> i16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i16 | Left-hand value. |
right | yes | i16 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> u32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u32 | Left-hand value. |
right | yes | u32 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> i32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i32 | Left-hand value. |
right | yes | i32 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> u64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u64 | Left-hand value. |
right | yes | u64 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> i64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i64 | Left-hand value. |
right | yes | i64 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> f16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f16 | Left-hand value. |
right | yes | f16 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> f32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f32 | Left-hand value. |
right | yes | f32 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> f64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f64 | Left-hand value. |
right | yes | f64 | Right-hand value. |
Returns
The product as a value or expression.
spql.mul(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
The product as a value or expression.
spql.neq
Return whether two values are not equal.
- Kind:
scalar function - Volatility:
immutable
spql.neq(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
A boolean value or expression.
spql.not
Invert a boolean value.
- Kind:
scalar function - Volatility:
immutable
spql.not(value) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | bool | Boolean value to negate. |
Returns
A boolean value or expression.
spql.not_ilike
Return whether a UTF8 value does not match a SQL ILIKE pattern.
- Kind:
scalar function - Volatility:
immutable
spql.not_ilike(value, pattern) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Input UTF8 value. |
pattern | yes | utf8 | SQL pattern. |
Returns
A boolean value or expression.
spql.not_like
Return whether a UTF8 value does not match a SQL LIKE pattern.
- Kind:
scalar function - Volatility:
immutable
spql.not_like(value, pattern) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Input UTF8 value. |
pattern | yes | utf8 | SQL pattern. |
Returns
A boolean value or expression.
spql.or
Return the boolean disjunction of two values.
- Kind:
scalar function - Volatility:
immutable
spql.or(left, right) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | bool | Left-hand boolean value. |
right | yes | bool | Right-hand boolean value. |
Returns
A boolean value or expression.
spql.sub
Subtract the right value from the left value.
- Kind:
scalar function - Volatility:
immutable
spql.sub(left, right) -> u8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u8 | Left-hand value. |
right | yes | u8 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> i8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i8 | Left-hand value. |
right | yes | i8 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> u16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u16 | Left-hand value. |
right | yes | u16 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> i16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i16 | Left-hand value. |
right | yes | i16 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> u32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u32 | Left-hand value. |
right | yes | u32 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> i32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i32 | Left-hand value. |
right | yes | i32 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> u64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | u64 | Left-hand value. |
right | yes | u64 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> i64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | i64 | Left-hand value. |
right | yes | i64 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> f16?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f16 | Left-hand value. |
right | yes | f16 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> f32?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f32 | Left-hand value. |
right | yes | f32 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> f64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | f64 | Left-hand value. |
right | yes | f64 | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | T | Left-hand value. |
right | yes | T | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Temporal overloads retain the date or timestamp type, unit and timezone. An Interval applies months first, clamping to the target month's last valid day, then calendar days, then elapsed nanoseconds. Subtraction negates each component and uses the same order. Month clamping is neither associative nor reversible.
Calendar components modify local fields and resolve their combined result once, rejecting repeated or skipped local times before applying elapsed nanoseconds. Zero calendar components preserve the input instant. A Duration is entirely elapsed time. Date results must be whole days; timestamp results must be exact in their retained unit. Null operands propagate null. Overflow and non-null intervals with null components fail.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | vortex.date | vortex.timestamp | Left-hand value. |
right | yes | spql.Interval | spql.Duration | Right-hand value. |
Returns
The difference as a value or expression.
spql.sub(left, right) -> inferredThe result type and nullability are inferred from the argument types when the call is bound.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
left | yes | vortex.timestamp | The timestamp subtracted from. |
right | yes | vortex.timestamp | The timestamp subtracted. |
Returns
The difference as a value or expression.