GlareDB / glaredb

GlareDB: An analytics DBMS for distributed data
https://glaredb.com
GNU Affero General Public License v3.0
635 stars 36 forks source link

Function namespaces should influence the schema function entries get inserted into #2371

Open scsmithr opened 8 months ago

scsmithr commented 8 months ago

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 dumps pg_catalog.array_to_string into the default schema with the name array_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 from BuiltinScalarUDF to BuiltinFunction, then get the namespace when building the catalog to get the appropriate schema.

universalmind303 commented 7 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.

tychoish commented 7 months ago

[pulled out of priority queue, because it's a polish thing and not blocking anything so it's safe to defer at the moment.]