-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Support WASM plugins for UDF/TableFunctions/more #36892
Description
Use case
I would like to inform clickhouse how to mutate data and join it together in a bespoke pattern.
Describe the solution you'd like
Loadable WASM with known strictly typed interfaces that can be executed upon to not only be able to execute functions, but possibly even alter the AST of the query for optimization, or possibly an entire table function or table engine as a WASM blob. The advantage here would be passing rich types in and out of known interfaces that can be met by coding in any language that can compile to WASM, which is a fair number at this point. WASM runtimes for c[++] are around so this should be rather possible.
Describe alternatives you've considered
executable UDFs are available in clickhouse but that is a strict stdin/stdout flow of data, and could not easily be used in a more constructive way like table functions or AST optimization.
Additional context
This is a pattern being picked up by several systems/databases recently, including redpanda, postgresql (via extension)