Text Functions
Text functions operate on string values. They are used to combine, transform, or evaluate textual data. These functions are common in projections, filters, and computations that involve string manipulation.
Usage
Text functions are defined using dedicated top-level expression forms, such as $concat.
These functions accept one or more expressions that evaluate to text.
Operands can include string literals, column references, or nested expressions.
They can be freely combined with other expression types and used anywhere expressions are allowed.
- All inputs must be string-compatible.
- If any operand evaluates to
null, the entire result isnull. - Evaluation proceeds from left to right.
$concat
Added in: indicate.dsl.dql@1.0.0
Concatenates multiple expressions using the || operator.
{
"$concat": [
{ object (Expression) },
{ object (Expression) },
...
]
}
- JSON
- SQL
{
"$concat": [
{ "$scalar": "Hello, " },
{ "$scalar": "world!" }
]
}
'Hello, ' || 'world!'
$lower
Added in: indicate.dsl.dql@1.0.0
Converts a string to lowercase.
{
"$fn": "lower",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$fn": "lower",
"$operand": { "$scalar": "HELLO WORLD" }
}
LOWER('HELLO WORLD')
$upper
Added in: indicate.dsl.dql@1.0.0
Converts a string to uppercase.
{
"$fn": "upper",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$fn": "upper",
"$operand": { "$scalar": "hello world" }
}
UPPER('hello world')
$length
Added in: indicate.dsl.dql@1.0.0
Returns the number of characters in a string.
{
"$fn": "length",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$fn": "length",
"$operand": { "$scalar": "Invoice-2024" }
}
LENGTH('Invoice-2024')
$substring
Added in: indicate.dsl.dql@1.0.0
Extracts a substring starting at a specific position for a given length.
{
"$fn": "substring",
"$operands": [
{ object (Expression) },
{ object (Expression) },
{ object (Expression) }
]
}
- JSON
- SQL
{
"$fn": "substring",
"$operands": [
{ "$scalar": "ProductCode123" },
{ "$scalar": 1 },
{ "$scalar": 7 }
]
}
SUBSTRING('ProductCode123', 1, 7)
$replace
Added in: indicate.dsl.dql@1.0.0
Replaces all occurrences of a substring with another substring.
{
"$fn": "replace",
"$operands": [
{ object (Expression) },
{ object (Expression) },
{ object (Expression) }
]
}
- JSON
- SQL
{
"$fn": "replace",
"$operands": [
{ "$scalar": "I like apples" },
{ "$scalar": "apples" },
{ "$scalar": "oranges" }
]
}
REPLACE('I like apples', 'apples', 'oranges')
$trim
Added in: indicate.dsl.dql@1.0.0
Removes leading and trailing whitespace from a string.
{
"$fn": "trim",
"$operand": { object (Expression) }
}
- JSON
- SQL
{
"$fn": "trim",
"$operand": { "$scalar": " cancelled " }
}
TRIM(' cancelled ')