Skip to content

fix(grl-823): lane functions - #576

Open
ivanmiletic wants to merge 7 commits into
release/2.2from
fix/grl-823-lane-functions
Open

ivanmiletic wants to merge 7 commits into
release/2.2from
fix/grl-823-lane-functions

Conversation

@ivanmiletic

Copy link
Copy Markdown
Contributor

No description provided.

…ions

stddev, variance, stddevPop, variancePop, skew, kurtosis, percentile,
percentileApprox (t-digest, compression 100), countDistinct (count_distinct),
countDistinctApprox (HLL p12 over xxh64 of the canonical value), distinct
(unique), topK, first, last, argMax (maxBy) and argMin (minBy).

Aggregates take a projection and an optional filter over the items, with #
or a name given with 'as': sum(items as t, t.amount, t.ok). The parser
rewrites them to map/filter closures and a null-skipping aggregate, so the
stack VM, the lane VM, intellisense and dependency analysis share one form.
Existing calls keep their behaviour: a callback form of sum, avg, min, max,
median and mode needs # or a name.
join (separator ',' by default, nulls skipped), replace and replaceAll
(regular expressions), squish, unaccent, tokenSort, nameKey, soundex,
jaroWinkler and tokenSetSimilarity (a string or each string of a list),
on the stack VM and the lane VM.
…nt from the end

take, takeLast, find, findLast, findIndex, findLastIndex (-1 when none),
sort and sortBy ('asc' or 'desc', stable, nulls last) and isEmpty. find,
findIndex and sortBy take a callback with # or a name given with 'as'.

items[-1] is the last item, as documented, on the stack VM and the lane
VM (a string counts from its end too); a negative index past the start is
null. The spec rows that recorded the bug, the policy spec case and its
golden now expect the value.
clamp, sqrt, ln, log (base 10 or a given base), exp, sign, padStart and
padEnd (to a length in characters, spaces by default), splitPart (from 1,
negative from the end, null when missing) and extractAll (every match, or
the first group of every match), on the stack VM and the lane VM.
md5, sha256 and xxhash64 (lower-case hex), jsonParse and jsonString,
entries, zip and groupBy (an object of arrays by a key given with # or a
name; null keys skipped), on the stack VM and the lane VM.
…many inputs on the lane VM

A thin wrapper over LaneProgram and LaneRunner: rows (specialized on a
sample above 64), scopes or columns, with an evaluation context; plus
evaluate_expression_batch. Results equal row-by-row evaluation.
register_host_function adds a named function (signature and
implementation) that every thread parses, type-checks, completes and
evaluates as FunctionKind::Host, on the stack VM and the lane VM; built-in
names cannot be taken. The lane passes the name to one host builtin that
drives the registered definition, so both engines give the same result.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant