cockroachdb / cockroachdb/cockroach

User Defined Functions - Support custom binaries with STDIN/STDOUT

Offen
#93,409 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
A-sql-routine C-enhancement O-community T-sql-queries
Vorherrschende Sprache
Go
Sterne
32.5k
Forks
4.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

It would be extremely useful if we could create our own user defined functions in any language we choose, adding unparalleled flexibility to CRDB. It would provide capabilities like self-run version of Cloudflare's Durable Objects.

Clickhouse does this very well with strong specifications and error handling policies: https://clickhouse.com/docs/en/sql-reference/functions/

Processing through STDIN & STDOUT allows any lanugage to be used as long as the function respects the expect data formats.

Support for SELECTs would be more than enough, as the result of a SELECT could be inserted. For example one function I've always wanted in CRDB is HyperLogLog support. Functions could be made like `hll_merge(IDENTIFIER, NEW_VAL)`, where to update a HLL you UPSERT the result of `hll_merge`, then use a function `hll_count(IDENTIFIER)` to read it.

Some immediate capabilities that could be unlocked are:
1. HyperLogLogs
2. Bloom filters
3. Complex running aggregations (materialized as well)
4. Room/multiplayer session management (e.g. collaborating on a google doc)

Jira issue: CRDB-22319

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.