Functions Reference¶
This document lists every scalar and aggregate function currently implemented by AdxLite. Each entry includes the function signature, a short description, parameter table, return type, example, and notes.
For operator syntax such as matches regex or between, see Operators reference. For data type behavior, see Type system.
Function categories¶
- Aggregation functions: Aggregation functions are intended for
summarizeclauses. They consume the current group and return one value per group. - String and encoding functions: These functions operate on text values. Unless stated otherwise, results are strings or integer/string-derived values.
- Math functions: Math helpers are available in scalar expressions such as
extend,project, and predicates. - Datetime functions: Datetime helpers operate on ISO-8601 text and datetime-typed columns using the project's local datetime semantics.
- Regex and JSON functions: These functions support partial regex search, capture extraction, and JSON-text workflows.
- Conditional and conversion functions: These functions help with branching, null handling, and type conversion.
General notes¶
- Function names are parsed case-insensitively.
- Aggregate functions are intended for
summarizeand are not valid in general scalar positions. - Many functions return
null/missing values when required inputs are null. - JSON-oriented helpers return JSON text or string values rather than nested dynamic objects.
- When exact semantics differ from Azure Data Explorer, the notes call that out or point to Limitations.
Aggregation functions¶
Aggregation functions are intended for summarize clauses. They consume the current group and return one value per group.
count¶
Signature
Description
Counts input rows in the current group or entire input when no grouping key is present.
Parameters
This function takes no parameters.
Return type
long
Example
Notes
- Use inside
summarize. - On empty input without grouping, returns
0.
sum¶
Signature
Description
Sums numeric values.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
numeric expression | Value to sum |
Return type
same logical numeric family as input, commonly real or long
Example
Notes
- Nulls are ignored according to underlying aggregation behavior.
avg¶
Signature
Description
Computes the arithmetic mean of numeric values.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
numeric expression | Value to average |
Return type
real
Example
Notes
- Typically returns floating-point output.
min¶
Signature
Description
Returns the minimum value in each group.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
scalar expression | Value to compare |
Return type
same logical type as the input expression when inferable
Example
Notes
- Works for numbers, strings, and datetimes using the engine's current comparison semantics.
max¶
Signature
Description
Returns the maximum value in each group.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
scalar expression | Value to compare |
Return type
same logical type as the input expression when inferable
Example
Notes
- Useful for latest timestamp or highest score style queries.
dcount¶
Signature
Description
Counts distinct non-null values.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
scalar expression | Value whose distinct count should be computed |
Return type
long
Example
Notes
- Implemented as exact distinct count, not approximate HyperLogLog-style behavior.
countif¶
Signature
Description
Counts rows for which the predicate is true.
Parameters
| Name | Type | Description |
|---|---|---|
predicate |
bool expression | Condition to test per row |
Return type
long
Example
Notes
- Equivalent to summing a boolean predicate over the group.
sumif¶
Signature
Description
Sums values only for rows matching the predicate.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
numeric expression | Value to sum |
predicate |
bool expression | Condition selecting rows to include |
Return type
same logical numeric family as input, commonly real or long
Example
Notes
- Rows failing the predicate do not contribute to the sum.
avgif¶
Signature
Description
Averages values only for rows matching the predicate.
Parameters
| Name | Type | Description |
|---|---|---|
expr |
numeric expression | Value to average |
predicate |
bool expression | Condition selecting rows to include |
Return type
real
Example
Notes
- Useful for conditional metrics without pre-filtering the whole dataset.
String and encoding functions¶
These functions operate on text values. Unless stated otherwise, results are strings or integer/string-derived values.
tolower¶
Signature
Description
Converts text to lowercase.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Useful for explicit case normalization before comparisons.
toupper¶
Signature
Description
Converts text to uppercase.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Useful for display or normalization.
strlen¶
Signature
Description
Returns string length.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
long
Example
Notes
- Counts characters according to the underlying engine string semantics.
trim¶
Signature
Description
Trims whitespace or a specified set of characters from both ends of a string.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text when using one argument |
chars |
string | Characters to trim when using the two-argument form |
Return type
string
Example
Notes
- In the two-argument form, the first argument is the trim character set and the second is the text value.
substring¶
Signature
Description
Returns a substring using 0-based indexing.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
start |
long | 0-based start position |
length |
long | Optional length |
Return type
string
Example
Notes
- The start index is 0-based in AdxLite.
strcat¶
Signature
Description
Concatenates one or more values as text.
Parameters
| Name | Type | Description |
|---|---|---|
arg1..n |
scalar | Values to concatenate in order |
Return type
string
Example
Notes
- At least one argument is required.
replace_string¶
Signature
Description
Replaces all occurrences of one substring with another.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
old |
string | Substring to replace |
new |
string | Replacement text |
Return type
string
Example
Notes
- Replacement is literal string replacement, not regex replacement.
reverse¶
Signature
Description
Reverses the characters in a string.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Null input returns null.
countof¶
Signature
Description
Counts occurrences of a substring.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
needle |
string | Substring to count |
Return type
long
Example
Notes
- Uses non-overlapping substring counting semantics.
indexof¶
Signature
Description
Returns the 0-based position of the first substring occurrence.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
needle |
string | Substring to locate |
Return type
long
Example
Notes
- Returns
-1when the substring is not found.
split¶
Signature
Description
Splits text by a delimiter and returns a JSON array string.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
delimiter |
string | Separator |
Return type
string (JSON array text)
Example
Notes
- The result is JSON text such as
["a", "b"], not a native array column.
url_encode¶
Signature
Description
Percent-encodes text for URL usage.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Backed by Python URL quoting logic.
url_decode¶
Signature
Description
Decodes percent-encoded URL text.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Useful when ingesting URL-escaped payloads.
base64_encode_tostring¶
Signature
Description
Encodes text as Base64.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Input text |
Return type
string
Example
Notes
- Output is ASCII Base64 text.
base64_decode_tostring¶
Signature
Description
Decodes Base64 text into a string.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | Base64 input |
Return type
string
Example
Notes
- Invalid Base64 raises an execution-time failure in the underlying Python helper.
Math functions¶
Math helpers are available in scalar expressions such as extend, project, and predicates.
log¶
Signature
Description
Computes the natural logarithm.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
real
Example
Notes
- Null input returns null.
log2¶
Signature
Description
Computes the base-2 logarithm.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
real
Example
Notes
- Useful for power-of-two style metrics.
log10¶
Signature
Description
Computes the base-10 logarithm.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
real
Example
Notes
- Used in the test suite for numeric validation.
pow¶
Signature
Description
Raises the first value to the power of the second.
Parameters
| Name | Type | Description |
|---|---|---|
left |
numeric | Base |
right |
numeric | Exponent |
Return type
real
Example
Notes
- Returns floating-point output.
sqrt¶
Signature
Description
Computes the square root.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
real
Example
Notes
- Used in integration tests with floating-point comparisons.
exp¶
Signature
Description
Computes e raised to the given value.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Exponent |
Return type
real
Example
Notes
- Backed by Python math semantics in the UDF layer.
ceiling¶
Signature
Description
Rounds a numeric value upward to the nearest integer.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
long
Example
Notes
- Returns integer-like output.
floor¶
Signature
Description
Rounds a numeric value downward to the nearest integer.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
long
Example
Notes
- Returns integer-like output.
sign¶
Signature
Description
Returns -1, 0, or 1 depending on the sign of the input.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
long
Example
Notes
- Negative values map to
-1, positive values to1, and zero to0.
pi¶
Signature
Description
Returns the mathematical constant π.
Parameters
This function takes no parameters.
Return type
real
Example
Notes
- Takes no arguments.
round¶
Signature
Description
Rounds a numeric value, optionally to a specified number of digits.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
digits |
long | Optional number of digits |
Return type
real
Example
Notes
- When
digitsis omitted, rounds to the nearest integer-style value.
abs¶
Signature
Description
Returns absolute value.
Parameters
| Name | Type | Description |
|---|---|---|
value |
numeric | Input value |
Return type
real or long depending on input
Example
Notes
- Useful when analyzing signed differences.
Datetime functions¶
Datetime helpers operate on ISO-8601 text and datetime-typed columns using the project's local datetime semantics.
now¶
Signature
Description
Returns the current UTC timestamp as an ISO-8601 string value.
Parameters
This function takes no parameters.
Return type
datetime-like string
Example
Notes
- Current implementation uses UTC and emits ISO text.
ago¶
Signature
Description
Subtracts a timespan from the current UTC time.
Parameters
| Name | Type | Description |
|---|---|---|
timespan |
timespan literal | Duration such as 1d or 30m |
Return type
datetime-like string
Example
Notes
- Supported timespan units are
d,h,m,s, andms.
bin¶
Signature
Description
Rounds a datetime value down to the nearest bucket boundary.
Parameters
| Name | Type | Description |
|---|---|---|
value |
datetime-like | Input timestamp |
timespan |
timespan literal | Bucket width |
Return type
datetime-like string
Example
Notes
- Commonly used before
summarizefor time bucketing.
datetime_diff¶
Signature
Description
Returns the difference between two datetimes in the requested unit.
Parameters
| Name | Type | Description |
|---|---|---|
unit |
string | day, hour, minute, second, or millisecond |
left |
datetime-like | Left timestamp |
right |
datetime-like | Right timestamp |
Return type
long
Example
Notes
- The result can be negative when
leftis earlier thanright.
format_datetime¶
Signature
Description
Formats a datetime value as text.
Parameters
| Name | Type | Description |
|---|---|---|
value |
datetime-like | Input timestamp |
format |
string | Format string using tokens such as yyyy, MM, dd, HH, mm, ss |
Return type
string
Example
Notes
- Supported format tokens are a small documented subset, not the full Kusto formatter.
datetime_add¶
Signature
Description
Adds a timespan to a datetime value.
Parameters
| Name | Type | Description |
|---|---|---|
timespan |
timespan literal | Duration to add |
value |
datetime-like | Input timestamp |
Return type
datetime-like string
Example
Notes
- AdxLite uses a simplified two-argument signature.
Regex and JSON functions¶
These functions support partial regex search, capture extraction, and JSON-text workflows.
extract¶
Signature
Description
Extracts a regex capture group from text.
Parameters
| Name | Type | Description |
|---|---|---|
pattern |
string | Regex pattern |
group |
long | Capture group index |
text |
string | Input text |
Return type
string or null
Example
Notes
- Uses Python regex search semantics and returns the chosen subgroup.
parse_json¶
Signature
Description
Parses JSON-like input and returns normalized JSON text.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string or JSON-like value | JSON input |
Return type
string (JSON text)
Example
Notes
- The result is JSON text, not a nested Python object in the DataFrame.
dynamic¶
Signature
Description
Alias for parse_json(text) in the current implementation.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string or JSON-like value | JSON input |
Return type
string (JSON text)
Example
Notes
- Use when you want Kusto-style dynamic naming but AdxLite still returns JSON text.
extractjson¶
Signature
Description
Extracts a value from JSON text using a simple JSONPath-like selector.
Parameters
| Name | Type | Description |
|---|---|---|
path |
string | Path such as $.count or $.items[0] |
json_text |
string | JSON input text |
Return type
string or JSON text or null
Example
Notes
- Scalar outputs are returned as strings; arrays and objects are returned as JSON text.
Conditional and conversion functions¶
These functions help with branching, null handling, and type conversion.
iif¶
Signature
Description
Returns one of two values depending on a predicate.
Parameters
| Name | Type | Description |
|---|---|---|
predicate |
bool expression | Condition |
then_value |
scalar | Value returned when predicate is true |
else_value |
scalar | Value returned when predicate is false |
Return type
same general type family as branch expressions
Example
Notes
iff()is an exact alias.
iff¶
Signature
Description
Alias for iif(predicate, then_value, else_value).
Parameters
| Name | Type | Description |
|---|---|---|
predicate |
bool expression | Condition |
then_value |
scalar | True branch |
else_value |
scalar | False branch |
Return type
same general type family as branch expressions
Example
Notes
- Included for Kusto familiarity.
coalesce¶
Signature
Description
Returns the first non-null value from the argument list.
Parameters
| Name | Type | Description |
|---|---|---|
arg1..n |
scalar | Candidate values evaluated left to right |
Return type
type of the first non-null branch at runtime
Example
Notes
- At least one argument is required.
isnull¶
Signature
Description
Checks whether a value is null.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to test |
Return type
bool
Example
Notes
- Useful for nullable or partially populated datasets.
isnotnull¶
Signature
Description
Checks whether a value is not null.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to test |
Return type
bool
Example
Notes
- Negated counterpart to
isnull().
isempty¶
Signature
Description
Checks whether a value is null or the empty string.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to test |
Return type
bool
Example
Notes
- Treats null and empty text as empty.
isnotempty¶
Signature
Description
Checks whether a value is neither null nor the empty string.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to test |
Return type
bool
Example
Notes
- Useful before string operations on optional fields.
tostring¶
Signature
Description
Casts a value to text.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to convert |
Return type
string
Example
Notes
- Helpful before concatenation or display formatting.
toint¶
Signature
Description
Converts a value to an integer-like representation.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to convert |
Return type
long
Example
Notes
- Prefer clean numeric input for predictable results across SQL and pandas paths.
tolong¶
Signature
Description
Converts a value to a long integer representation.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to convert |
Return type
long
Example
Notes
- Implemented with the same underlying cast behavior as
toint().
todouble¶
Signature
Description
Converts a value to floating-point.
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to convert |
Return type
real
Example
Notes
- Use when numeric text should participate in arithmetic.
toreal¶
Signature
Description
Alias for todouble(value).
Parameters
| Name | Type | Description |
|---|---|---|
value |
scalar | Value to convert |
Return type
real
Example
Notes
- Included for Kusto naming familiarity.