Skip to main content

Module func

Module func 

Source

Structsยง

AnalyzedRegex
AnalyzedRegexOpts
CaptureGroupDesc
NaiveOneByOneAggr
Naive implementation of OneByOneAggr, suitable for stuff like const folding, but too slow for rendering. This relies only on infrastructure available in mz-expr. It simply saves all the given input, and calls the given AggregateFuncโ€™s eval method when asked about the current aggregate. (For Accumulable and Hierarchical aggregations, the rendering has more efficient implementations, but for Basic aggregations even the rendering uses this naive implementation.)
TimestampRangeStepInclusive
Like num::range_step_inclusive, but for our timestamp types using Interval for step.xwxw
WithOrdinality ๐Ÿ”’
Evaluates the inner table function, expands its results into unary (repeating each row as many times as the diff indicates), and appends an integer corresponding to the ordinal position (starting from 1). For example, it numbers the elements of a list when calling unnest_list.

Enumsยง

AggregateFunc
LagLeadType
Identify whether the given aggregate function is Lag or Lead, since they share implementations.
TableFunc
When adding a new TableFunc variant, please consider adding it to TableFunc::with_ordinality!

Constantsยง

REPEAT_ROW_NAME

Traitsยง

OneByOneAggr
An implementation of an aggregation where we can send in the input elements one-by-one, and can also ask the current aggregate at any moment. (This just delegates to other aggregation evaluation approaches.)

Functionsยง

acl_explode ๐Ÿ”’
all ๐Ÿ”’
any ๐Ÿ”’
array_concat ๐Ÿ”’
count ๐Ÿ”’
csv_extract
dense_rank ๐Ÿ”’
The expected input is in the format of [((OriginalRow, [EncodedArgs]), OrderByExprs...)] The output is in the format of [result_value, original_row]. See an example at lag_lead, where the input-output formats are similar.
dense_rank_no_list ๐Ÿ”’
Like dense_rank, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
dict_agg ๐Ÿ”’
expand_counts ๐Ÿ”’
Expands an iterator of (datum, diff) into one datum per unit of diff.
first_value ๐Ÿ”’
The expected input is in the format of [((OriginalRow, InputValue), OrderByExprsโ€ฆ)]
first_value_inner ๐Ÿ”’
first_value_no_list ๐Ÿ”’
Like first_value, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
fused_value_window_func ๐Ÿ”’
Executes FusedValueWindowFunc on a reduction group. The expected input is in the format of [((OriginalRow, (Args1, Args2, ...)), OrderByExprs...)] where Args1, Args2, are the arguments of each of the fused functions. For functions that have only a single argument (first_value/last_value), these are simple values. For functions that have multiple arguments (lag/lead), these are also records.
fused_value_window_func_no_list ๐Ÿ”’
Like fused_value_window_func, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
fused_window_aggr ๐Ÿ”’
Computes a bundle of fused window aggregations. The input is similar to window_aggr, but InputValue is not just a single value, but a record where each component is the input to one of the aggregations.
fused_window_aggr_no_list ๐Ÿ”’
Like fused_window_aggr, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
generate_series ๐Ÿ”’
generate_series_ts ๐Ÿ”’
generate_subscripts_array ๐Ÿ”’
jsonb_agg ๐Ÿ”’
jsonb_array_elements ๐Ÿ”’
jsonb_array_elements_stringify ๐Ÿ”’
jsonb_each ๐Ÿ”’
jsonb_each_stringify ๐Ÿ”’
jsonb_object_keys ๐Ÿ”’
lag_lead ๐Ÿ”’
The expected input is in the format of [((OriginalRow, EncodedArgs), OrderByExprs...)] For example,
lag_lead_inner ๐Ÿ”’
Each element of args has the 3 arguments evaluated for a single input row. Returns the results for each input row.
lag_lead_inner_ignore_nulls ๐Ÿ”’
lag_lead_inner_respect_nulls ๐Ÿ”’
lag_lead_no_list ๐Ÿ”’
Like lag_lead, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
last_value ๐Ÿ”’
The expected input is in the format of [((OriginalRow, InputValue), OrderByExprsโ€ฆ)]
last_value_inner ๐Ÿ”’
last_value_no_list ๐Ÿ”’
Like last_value, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
list_concat ๐Ÿ”’
max_datum ๐Ÿ”’
max_string ๐Ÿ”’
min_datum ๐Ÿ”’
min_string ๐Ÿ”’
mz_acl_explode ๐Ÿ”’
order_aggregate_datums
Assuming datums is a List, sort them by the 2nd through Nth elements corresponding to order_by, then return the 1st element.
order_aggregate_datums_with_rank ๐Ÿ”’
Assuming datums is a List, sort them by the 2nd through Nth elements corresponding to order_by, then return the 1st element and computed order by expression.
order_aggregate_datums_with_rank_inner ๐Ÿ”’
rank ๐Ÿ”’
The expected input is in the format of [((OriginalRow, [EncodedArgs]), OrderByExprs...)] The output is in the format of [result_value, original_row]. See an example at lag_lead, where the input-output formats are similar.
rank_no_list ๐Ÿ”’
Like rank, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
regexp_extract ๐Ÿ”’
regexp_matches ๐Ÿ”’
repeat_row
repeat_row_non_negative
row_number ๐Ÿ”’
The expected input is in the format of [((OriginalRow, [EncodedArgs]), OrderByExprs...)] The output is in the format of [result_value, original_row]. See an example at lag_lead, where the input-output formats are similar.
row_number_no_list ๐Ÿ”’
Like row_number, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
string_agg ๐Ÿ”’
sum_datum ๐Ÿ”’
sum_interval ๐Ÿ”’
Sums intervals component-wise, as PostgreSQLโ€™s interval addition does: months, days, and microseconds each accumulate on their own, and nothing is carried from a coarser component into a finer one.
sum_interval_counted ๐Ÿ”’
Count-aware interval sum. Accumulates ฮฃ valueยทdiff per interval component in i128, which matches Accum::Interval in mz_compute::render::reduce; the narrowing back to the Interval field widths reproduces that variantโ€™s finalize_accum arm. Consuming the multiplicity directly keeps this linear in the number of distinct values and correct for negative diffs (retractions), which expand_counts would silently drop.
sum_numeric ๐Ÿ”’
sum_signed_int_counted ๐Ÿ”’
Count-aware signed-integer sum. Accumulates ฮฃ valueยทdiff in i128, which matches the width of the dataflowโ€™s Accum::SimpleNumber accumulator (see build_accumulable and finalize_accum in mz_compute::render::reduce); narrow then reproduces that variantโ€™s finalize_accum arm. Unlike expand_counts, this consumes the multiplicity directly, so it is linear in the number of distinct values and correct for negative diffs (retractions), which expand_counts would silently drop.
unnest_array ๐Ÿ”’
unnest_list ๐Ÿ”’
unnest_map ๐Ÿ”’
unwrap_lag_lead_encoded_args ๐Ÿ”’
lag/leadโ€™s arguments are in a record. This function unwraps this record.
window_aggr ๐Ÿ”’
input_datums is an entire window partition. The expected input is in the format of [((OriginalRow, InputValue), OrderByExprs...)] See also in the comment in window_func_applied_to.
window_aggr_inner ๐Ÿ”’
window_aggr_no_list ๐Ÿ”’
Like window_aggr, but doesnโ€™t perform the final wrapping in a list, returning an Iterator instead.
wrap ๐Ÿ”’