New function: MAP_KEYS may conflict with similarly named UDFs¶
Attention
This behavior change is in the 2023_08 bundle.
For the current status of the bundle, refer to Bundle History.
Snowflake is introducing a new function named MAP_KEYS. If you have a UDF named MAP_KEYS, calls to your function have the following effect:
- Before the change:
A call to your UDF named MAP_KEYS resolves to your UDF.
- After the change:
A call to your UDF named MAP_KEYS resolves to the new built-in MAP_KEYS function, which fails with the following error:
Invalid argument types for function 'MAP_KEYS' ...
The call to your UDF fails because the arguments passed to your UDF do not match the arguments expected by the built-in function.
To avoid having calls to your UDF resolve to the built-in function, you can either:
Rename your UDF (using ALTER FUNCTION … RENAME TO …), and replace all references to the original UDF name with the new name.
Fully qualify all references to your UDF by specifying the names of the database and schema containing the UDF. For example:
SELECT my_database.my_schema.map_keys(...);
Ref: 1430