CANNOT_LOAD_STATE_STORE error class
CANNOT_READ_FILE error class
CANNOT_UPDATE_FIELD error class
CAST_INVALID_INPUT error class
COLUMN_MASKS_FEATURE_NOT_SUPPORTED error class
CONNECT error class
CREATE_VIEW_COLUMN_ARITY_MISMATCH error class
DATATYPE_MISMATCH error class
DELTA_ICEBERG_COMPAT_V1_VIOLATION error class
DELTA_VERSIONS_NOT_CONTIGUOUS error class
DELTA_VIOLATE_TABLE_PROPERTY_VALIDATION_FAILED error class
DIVIDE_BY_ZERO error class
DUPLICATE_ROUTINE_PARAMETER_ASSIGNMENT error class
FROM_JSON_INVALID_CONFIGURATION error class
GEOJSON_PARSE_ERROR error class
GROUP_BY_AGGREGATE error class
H3_INVALID_CELL_ID error class
H3_INVALID_GRID_DISTANCE_VALUE error class
H3_INVALID_RESOLUTION_VALUE error class
H3_NOT_ENABLED error class
INCOMPATIBLE_DATA_FOR_TABLE error class
INCOMPLETE_TYPE_DEFINITION error class
INCONSISTENT_BEHAVIOR_CROSS_VERSION error class
INSERT_COLUMN_ARITY_MISMATCH error class
INSUFFICIENT_TABLE_PROPERTY error class
INTERNAL_ERROR_METADATA_CATALOG error class
INVALID_ARRAY_INDEX error class
INVALID_ARRAY_INDEX_IN_ELEMENT_AT error class
INVALID_BOUNDARY error class
INVALID_CURSOR error class
INVALID_DEFAULT_VALUE error class
INVALID_FORMAT error class
INVALID_HANDLE error class
INVALID_INLINE_TABLE error class
INVALID_LAMBDA_FUNCTION_CALL error class
INVALID_LIMIT_LIKE_EXPRESSION error class
INVALID_OBSERVED_METRICS error class
INVALID_OPTIONS error class
INVALID_PARAMETER_MARKER_VALUE error class
INVALID_PARAMETER_VALUE error class
INVALID_PARTITION_OPERATION error class
INVALID_SCHEMA error class
INVALID_SECRET_LOOKUP error class
INVALID_SQL_SYNTAX error class
INVALID_SUBQUERY_EXPRESSION error class
INVALID_TIME_TRAVEL_TIMESTAMP_EXPR error class
INVALID_WRITE_DISTRIBUTION error class
MALFORMED_RECORD_IN_PARSING error class
MATERIALIZED_VIEW_OPERATION_NOT_ALLOWED error class
MISSING_AGGREGATION error class
MISSING_ATTRIBUTES error class
NOT_A_CONSTANT_STRING error class
NOT_ALLOWED_IN_FROM error class
NOT_NULL_CONSTRAINT_VIOLATION error class
NOT_SUPPORTED_IN_JDBC_CATALOG error class
QUERIED_TABLE_INCOMPATIBLE_WITH_COLUMN_MASK_POLICY error class
QUERIED_TABLE_INCOMPATIBLE_WITH_ROW_LEVEL_SECURITY_POLICY error class
ROW_COLUMN_ACCESS error class
ROW_LEVEL_SECURITY_FEATURE_NOT_SUPPORTED error class
STREAMING_TABLE_OPERATION_NOT_ALLOWED error class
TABLE_OR_VIEW_NOT_FOUND error class
UC_COMMAND_NOT_SUPPORTED error class
UDF_USER_CODE_ERROR error class
UNKNOWN_FIELD_EXCEPTION error class
UNRESOLVED_COLUMN error class
UNRESOLVED_FIELD error class
UNRESOLVED_MAP_KEY error class
UNRESOLVED_ROUTINE error class
UNSUPPORTED_ADD_FILE error class
UNSUPPORTED_DEFAULT_VALUE error class
UNSUPPORTED_DESERIALIZER error class
UNSUPPORTED_FEATURE error class
UNSUPPORTED_GENERATOR error class
UNSUPPORTED_INSERT error class
UNSUPPORTED_MERGE_CONDITION error class
UNSUPPORTED_OVERWRITE error class
UNSUPPORTED_SAVE_MODE error class
UNSUPPORTED_SUBQUERY_EXPRESSION_CATEGORY error class
UPGRADE_NOT_SUPPORTED error class
USER_DEFINED_FUNCTIONS error class
WKB_PARSE_ERROR error class
WKT_PARSE_ERROR error class
WRONG_NUM_ARGS error class
UNRESOLVED_ROUTINE error class
SQLSTATE: 42883
Cannot resolve function
<routineName>
on search path
<searchPath>
.
Parameters
routineName
: The name of the function which cannot be resolved.
searchPath
: The ordered list of schemas that was searched if
routineName
was not schema qualified.
Explanation
Persisted functions consist of a three name parts:
<catalog>.<schema>.<relation>
.
If you do not specify all three parts of the name, it is implicitly completed using the current catalog or the current schema.
This is similar to the way how the working directory of your filesystem influences which files you can see, unless you fully specify the path.
Temporary functions only exist within the session or query and must never be qualified.
The most common reason for not finding a function are:
The function doesn’t exist.
The function name is misspelled.
The user defined function is located in a different schema.
The user defined function is not located in the current schema.
You can’t view the user-defined function because you don’t have access.
The built-in function you are trying to invoke is not available on this release of Databricks.
Mitigation
Mitigate errors by reviewing the following.
Did you spell the function name incorrectly?
Use
`SHOW FUNCTIONS IN <schema>`
to verify the correct function name.
Is the function is a different schema?
If the function is located on a catalog in Unity Catalog, run the following query:
SELECT
routine_schema
FROM
information_schema.routines
WHERE
routine_name
=
'<routinename>'
This lists the schema within the current catalog where the function is located.
If the function is located outside Unity Catalog, use
`SHOW SCHEMAS`
to find candidate schemas.
Use
`SHOW FUNCTIONS IN <schema>`
to probe for the function.
Did you not fully qualify the name, and the result of
`VALUES current_schema()`
does not match the qualified name of the function?
Qualify
functionName
with its schema and catalog, or run
`USE SCHEMA`
to set the implicit schema.
Did you reference a temporary function, but it was in a previous, expired, or different session?
Recreate the temporary function using
`CREATE TEMPORARY FUNCTION <routineName> …`
, or switch to using a persisted function.
Do you want to issue a DDL statement, such as
DROP
FUNCTION
just in case the object exists?
Issue the statement using the
IF
EXISTS
clause, such as:
`DROP FUNCTION <routineName> IF EXISTS`
.
Do you know the function exists, but you cannot see it in
`SHOW FUNCTIONS`
?
Contact your administrator to get access to the function. You may also need access to the schema and catalog.
For more information on how to resolve the error, see
Function resolution
.
Examples
> CREATE SCHEMA IF NOT EXISTS myschema;
> CREATE OR REPLACE FUNCTION myschema.myfunc() RETURNS INT RETURN 5;
-- The function name has been misspelled
> SELECT myschema.myfun();
[UNRESOLVED_ROUTINE] Cannot resolve function `myschema`.`myfun` on search path [`system`.`builtin`, `system`.`session`, `spark_catalog`.`default`].; line 1 pos 7
-- Use SHOW FUNCTIONS to find the correct nme
> SHOW USER FUNCTIONS IN myschema;
spark_catalog.myschema.myfunc
-- Correct the spelling
> SELECT myschema.myfunc();
-- The qualifier has been misspelled
> CREATE SCHEMA IF NOT EXISTS wrongschema;
> SELECT wrongschema.myfunc;
[UNRESOLVED_ROUTINE] Cannot resolve function `wrongschema`.`myfunc` on search path [`system`.`builtin`, `system`.`session`, `spark_catalog`.`default`].; line 1 pos 7
-- Find candidate schemas
> SHOW SCHEMAS;
myschema
wrongschema
-- Verify the function exists in the candidate schema
> SHOW USER FUNCTIONS IN myschema;
spark_catalog.myschema.myfunc
> SELECT myschema.myfunc();
-- Change current schema to find an unqualified function
> SELECT myfunc();
[UNRESOLVED_ROUTINE] Cannot resolve function `myfunc` on search path [`system`.`builtin`, `system`.`session`, `spark_catalog`.`default`].; line 1 pos 7
> USE SCHEMA myschema;
SELECT myfunc();