-
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
TABLE_OR_VIEW_NOT_FOUND error class
SQLSTATE: 42P01
The table or view
<relationName>
cannot be found. Verify the spelling and correctness of the schema and catalog.
If you did not qualify the name with a schema, verify the current_schema() output, or qualify the name with the correct schema and catalog.
To tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF EXISTS.
Parameters
-
relationName
: The name of the specified relation (table or view) that cannot be found.
Explanation
Persisted tables and views consists 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 views or common table expressions (CTE) only exist within the session or query and must never be qualified.
The most common reason for not finding a table or view are:
-
The object simply doesn’t exist.
-
The object name, schema, or catalog was misspelled.
-
The object is not located in the current schema.
-
The user has no access to the object and therefore cannot see it.
Mitigation
The mitigation of the error depends on the cause:
-
Did you spell the table or view, schema, or catalog name incorrectly?
Correct the spelling.
-
Did you not fully qualify the name and the result of
`VALUES current_schema()`
does not match the qualified name of the table or view?
Explicitly qualify the
relationName
with its schema and catalog, or issue a
`USE SCHEMA`
command to set the desired implicit schema.
-
Did you reference a temporary view, but it was in a previous, expired, or different session?
Recreate the temporary view using
`CREATE TEMPORARY VIEW <relationName> …`
, or switch to using a permanent view.
-
Did you reference a common table expression (CTE), but it is out of scope?
Move the definition of the CTE to the outermost query. That is the beginning of the statement, so it is visible everywhere within the statement.
-
Do you want to issue a DDL statement, such as ‘DROP TABLE’ just in case the object exists?
Issue the statement using the
IF
EXISTS
clause, such as:
`DROP TABLE <relationName> IF EXISTS`
.
-
Do you know the object exists, but you cannot see it in
`SHOW TABLE`
?
Contact your administrator to get access to the table granted. This may need to include access to the schema and catalog as well.
-
It is unclear why you cannot resolve the table or view?
Refer to
Table and view resolution
for a detailed description of name resolution.
-- The table is located in othercat.someschema
> SELECT count(*) FROM t;
[TABLE_OR_VIEW_NOT_FOUND] The table or view `t` cannot be found.
> VALUES current_schema();
default
-- Change the current schema
> USE SCHEMA othercat.someschema;
> SELECT count(*) FROM T;
-- Alternatively qualify the table
> SELECT count(*) FROM othercat.someschema.t;
-- A reference to a CTE in the wrong scope:
> SELECT count(1) FROM (WITH v(c1) AS (VALUES (1)) VALUES(2)) AS t(c1), v;
[TABLE_OR_VIEW_NOT_FOUND] The table or view `v` cannot be found.
-- Move the CTE to top level
> WITH v(c1) AS (VALUES (1))
SELECT count(1) FROM VALUES(2) AS t(c1), v;
-- Dropping a non existing view
> DROP VIEW v;
[TABLE_OR_VIEW_NOT_FOUND] The table or view `v` cannot be found.
> DROP VIEW IF EXISTS v;