cockroachdb / cockroachdb/cockroach

User Defined Functions - Support custom binaries with STDIN/STDOUT

Aperta
#93,409 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
A-sql-routine C-enhancement O-community T-sql-queries
Lingua principale
Go
Stelle
32.5k
Fork
4.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.