-
ARITHMETIC_OVERFLOW error class
-
AS_OF_JOIN error class
-
CANNOT_CREATE_DATA_SOURCE_TABLE error class
-
CANNOT_LOAD_STATE_STORE error class
-
CANNOT_QUERY_TABLE_DURING_INITIALIZATION error class
-
CANNOT_READ_FILE error class
-
CANNOT_UPDATE_FIELD error class
-
CANNOT_WRITE_STATE_STORE error class
-
CAST_INVALID_INPUT error class
-
CF_FAILED_TO_INFER_SCHEMA error class
-
CF_INTERNAL_ERROR error class
-
CF_INVALID_MANAGED_FILE_EVENTS_RESPONSE error class
-
CODEC_NOT_AVAILABLE error class
-
COLLATION_MISMATCH error class
-
COLLECTION_SIZE_LIMIT_EXCEEDED error class
-
COLUMN_MASKS_FEATURE_NOT_SUPPORTED error class
-
COMPLEX_EXPRESSION_UNSUPPORTED_INPUT error class
-
CONNECT error class
-
COPY_INTO_COLUMN_ARITY_MISMATCH error class
-
COPY_INTO_STATE_INTERNAL_ERROR error class
-
COPY_INTO_SYNTAX_ERROR error class
-
CREATE_VIEW_COLUMN_ARITY_MISMATCH error class
-
DATATYPE_MISMATCH error class
-
DC_API_QUOTA_EXCEEDED error class
-
DC_CONNECTION_ERROR error class
-
DC_CONNECTOR_ERROR error class
-
DC_DYNAMICS_API_ERROR error class
-
DC_GA4_RAW_DATA_ERROR error class
-
DC_NETSUITE_ERROR error class
-
DC_SCHEMA_CHANGE_ERROR error class
-
DC_SERVICENOW_API_ERROR error class
-
DC_SFDC_API_ERROR error class
-
DC_SHAREPOINT_API_ERROR error class
-
DC_SQLSERVER_ERROR error class
-
DC_UNSUPPORTED_ERROR error class
-
DC_WORKDAY_RAAS_API_ERROR error class
-
DELTA_ICEBERG_COMPAT_V1_VIOLATION error class
-
DELTA_ICEBERG_COMPAT_VIOLATION error class
-
DELTA_UNIFORM_ICEBERG_INGRESS_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
-
EXPECT_TABLE_NOT_VIEW error class
-
EXPECT_VIEW_NOT_TABLE error class
-
FAILED_JDBC error class
-
FAILED_READ_FILE 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
-
ILLEGAL_STATE_STORE_VALUE 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
-
INVALID_AGGREGATE_FILTER error class
-
INVALID_ARRAY_INDEX error class
-
INVALID_ARRAY_INDEX_IN_ELEMENT_AT error class
-
INVALID_BOUNDARY error class
-
INVALID_CONF_VALUE error class
-
INVALID_CURSOR error class
-
INVALID_DATETIME_PATTERN error class
-
INVALID_DEFAULT_VALUE error class
-
INVALID_DELIMITER_VALUE error class
-
INVALID_FORMAT error class
-
INVALID_HANDLE error class
-
INVALID_INLINE_TABLE error class
-
INVALID_INTERVAL_FORMAT error class
-
INVALID_INVERSE_DISTRIBUTION_FUNCTION 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
-
KAFKA_DATA_LOSS error class
-
MALFORMED_RECORD_IN_PARSING error class
-
MATERIALIZED_VIEW_OPERATION_NOT_ALLOWED error class
-
METRIC_STORE_INVALID_ARGUMENT_VALUE_ERROR 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
-
NUMERIC_VALUE_OUT_OF_RANGE error class
-
QUERIED_TABLE_INCOMPATIBLE_WITH_COLUMN_MASK_POLICY error class
-
QUERIED_TABLE_INCOMPATIBLE_WITH_ROW_LEVEL_SECURITY_POLICY error class
-
RESTRICTED_STREAMING_OPTION_PERMISSION_ENFORCED error class
-
ROW_COLUMN_ACCESS error class
-
ROW_LEVEL_SECURITY_FEATURE_NOT_SUPPORTED error class
-
STDS_INVALID_OPTION_VALUE error class
-
STREAMING_TABLE_OPERATION_NOT_ALLOWED error class
-
SYNTAX_DISCONTINUED error class
-
TABLE_OR_VIEW_NOT_FOUND error class
-
UC_COMMAND_NOT_SUPPORTED error class
-
UDF_ERROR error class
-
UDF_LIMITS 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_CALL error class
-
UNSUPPORTED_COLLATION 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_STREAMING_OPTIONS_FOR_VIEW error class
-
UNSUPPORTED_SUBQUERY_EXPRESSION_CATEGORY error class
-
UNSUPPORTED_TABLE_OPERATION error class
-
UNSUPPORTED_VIEW_OPERATION 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();