-
I tried mapping DuckDB query plans to substrait and it seems like scalar and aggregate functions need to be in the extension definition and are then referred to by an ID. Is this correct? From the documentation it also seems like those function IDs are supposed to be system-specific, is that correct, too? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Arg, totally missed this question, sorry about that. I guess it doesn't show up in the slack alerts. Function ids themselves are just local to a particular plan and are a way of normalizing the actual function mapping which maps to a canonical location (e.g. uri) and key (just been updated to the name of the function plus the input argument types, used to be an integer offset). The goal is for the project itself to declare a common set of frequently functions signatures but then people should be able to also define their own function uris that hold additional custom functions signatures. For example, substrait has an aggregate function |
Beta Was this translation helpful? Give feedback.
-
Note that missing functionality can often be supplied by plan transformations (sometimes at a cost to performance) as well. For example, system A might support "add with saturating overflows" and system B may only support "add with null overflows". If the producer requests "add with saturating overflows" then a transformation library could write a plan for system B that does a coalesce after the add. There's also been some discussion of "optional behavior". For example, a producer might say "add and I don't care how overflow is handled" and both system A and system B could consume the plan and the producer has acknowledged and clearly communicated the behavior may depend on the system. An analogue might be something like instruction sets. x86 is a well known instruction set that many processors support. There are standard extensions like SSE4.2 that are multi-vendor but only provided by newer or more extensive processors. And there are extensions like FMA4 which are, at the moment, single-vendor only. |
Beta Was this translation helpful? Give feedback.
-
The documentation was updated in #76 and people will hopefully find answers in the extensions docs as well as the binary serialization docs. |
Beta Was this translation helpful? Give feedback.
The documentation was updated in #76 and people will hopefully find answers in the extensions docs as well as the binary serialization docs.