Follow-up from the review on #225.
SubstraitCustomFunctions::GetAllTypes() is the set of concrete Substrait type kinds an any/any1/unknown argument is expanded over when pre-building the overload maps. For an any-typed function to resolve, the argument type must be both (a) emitted by DuckToSubstraitType and (b) present in GetAllTypes().
Comparing the current list against the kinds the producer actually emits, it is inconsistent in both directions:
Dead entries (in GetAllTypes(), but the producer never emits them, so their any-overloads can never match):
varchar — DuckDB VARCHAR → substrait string
fixed_binary — DuckDB BLOB → substrait binary
interval_year — DuckDB INTERVAL → substrait interval_day
Missing (the producer emits them, but they are absent — so any-typed functions like equal on these arguments fall through to native, losing the extension URN and the compound signature name):
list, map, struct, user_defined
Suggested fix
Reconcile GetAllTypes() with the kinds DuckToSubstraitType can produce: drop the three dead entries and add list/map/struct.
user_defined needs extra care: its Substrait short name is u!<name>, but the protobuf Type.kind field name (user_defined) does not carry the type name, so it cannot be turned into a correct signature token from the kind alone (emitting ...:user_defined would be spec-wrong). It needs the user-defined type name threaded through, not just a list entry.
Notes
🤖 Generated with AI
Follow-up from the review on #225.
SubstraitCustomFunctions::GetAllTypes()is the set of concrete Substrait type kinds anany/any1/unknownargument is expanded over when pre-building the overload maps. For anany-typed function to resolve, the argument type must be both (a) emitted byDuckToSubstraitTypeand (b) present inGetAllTypes().Comparing the current list against the kinds the producer actually emits, it is inconsistent in both directions:
Dead entries (in
GetAllTypes(), but the producer never emits them, so theirany-overloads can never match):varchar— DuckDBVARCHAR→ substraitstringfixed_binary— DuckDBBLOB→ substraitbinaryinterval_year— DuckDBINTERVAL→ substraitinterval_dayMissing (the producer emits them, but they are absent — so
any-typed functions likeequalon these arguments fall through to native, losing the extension URN and the compound signature name):list,map,struct,user_definedSuggested fix
Reconcile
GetAllTypes()with the kindsDuckToSubstraitTypecan produce: drop the three dead entries and addlist/map/struct.user_definedneeds extra care: its Substrait short name isu!<name>, but the protobufType.kindfield name (user_defined) does not carry the type name, so it cannot be turned into a correct signature token from the kind alone (emitting...:user_definedwould be spec-wrong). It needs the user-defined type name threaded through, not just a list entry.Notes
timestamp/time/timestamp_tzkinds were already removed fromGetAllTypes()in fix: emit Substrait short names in compound function signatures #225.🤖 Generated with AI