Open scsmithr opened 8 months ago
we should probably hold off on this until we do https://github.com/GlareDB/glaredb/issues/2490.
That issue will likely result in a large refactor of our function registry anyways, so it'd probably be easiest to do them both in a single pass.
[pulled out of priority queue, because it's a polish thing and not blocking anything so it's safe to defer at the moment.]
Description
Followup from https://github.com/GlareDB/glaredb/issues/2368
Function names and function entries in the catalog are disjointed right now. When building the builtin catalog, all functions are iterated over, and placed into the default schema (public).
This is particularly troublesome with
array_to_string
since it's both a datafusion function, and an alias for postgres compatability (pg_catalog.array_to_string
). However, the existing logic dumpspg_catalog.array_to_string
into the default schema with the namearray_to_string
, completely disregarding the function namespace.The function namespace should be used when determining which schema to place functions in. I think the easiest thing to do would be move
namespace
fromBuiltinScalarUDF
toBuiltinFunction
, then get the namespace when building the catalog to get the appropriate schema.