SQL003 – Table Not Found Error in Databricks

Introduction

The SQL003 – Table Not Found error in Databricks indicates that the specified table does not exist or is inaccessible in the catalog, schema, or database you are querying. This error can occur in both Unity Catalog and Hive Metastore environments for several reasons, including misconfigured catalogs, incorrect table names, or missing permissions.


Common Causes and Fixes for SQL003 – Table Not Found

1. Incorrect Table Name or Schema

Symptoms:

  • Error: “SQL003: Table not found.”
  • The table does not exist in the specified schema or catalog.

Causes:

  • The table name or schema name is incorrect.
  • The table might exist in a different catalog or database.

Fix:
✅ Verify the correct table and schema names:

SHOW TABLES IN my_catalog.my_schema;

✅ Use the fully qualified table name:

SELECT * FROM my_catalog.my_schema.my_table;

✅ If unsure of the catalog, try listing all catalogs and schemas:

SHOW CATALOGS;
SHOW SCHEMAS IN my_catalog;

2. Unity Catalog Is Not Enabled or Misconfigured

Symptoms:

  • Error: “SQL003: Table not found.”
  • Unity Catalog is not available or not properly configured.

Causes:

  • Unity Catalog is not enabled for the cluster or SQL Warehouse.
  • The table is in a Hive Metastore but being queried as a Unity Catalog table.

Fix:
✅ Ensure Unity Catalog is enabled for the cluster:

  • Go to Clusters → Advanced Options and enable Unity Catalog.
    ✅ Verify the metastore assignment:
SHOW METASTORES;

✅ Switch back to Hive Metastore if needed:

USE DATABASE hive_metastore.default;

3. Table Has Been Dropped or Not Created

Symptoms:

  • Error: “SQL003: Table not found.”
  • The table was available earlier but now cannot be found.

Causes:

  • The table may have been dropped.
  • The table creation process may have failed or is incomplete.

Fix:
✅ Check the history of the table (if using Delta):

DESCRIBE HISTORY delta.`/mnt/delta/my_table/`;

✅ Recreate the table if necessary:

CREATE TABLE my_catalog.my_schema.my_table (id INT, name STRING);

4. Permissions Issue

Symptoms:

  • Error: “SQL003: Table not found.”
  • Table exists, but the user cannot access it.

Causes:

  • User lacks permissions to access the catalog, schema, or table.
  • The table permissions were recently changed.

Fix:
✅ Check table permissions:

SHOW GRANTS ON TABLE my_catalog.my_schema.my_table;

✅ Grant the necessary permissions:

GRANT SELECT ON TABLE my_catalog.my_schema.my_table TO `user@example.com`;

5. Table Exists in Another Catalog

Symptoms:

  • Error: “SQL003: Table not found.”
  • The table is present, but not in the queried catalog.

Causes:

  • The table was created in a different catalog or schema.

Fix:
✅ Check all available catalogs and schemas:

SHOW TABLES IN hive_metastore.default;
SHOW TABLES IN my_catalog.another_schema;

✅ Query using the fully qualified table name:

SELECT * FROM hive_metastore.default.my_table;

Step-by-Step Troubleshooting Guide

1. Verify Table Existence

SHOW TABLES IN my_catalog.my_schema;

2. Check for Correct Metastore and Catalog

SHOW METASTORES;

3. Ensure Proper Permissions

SHOW GRANTS ON TABLE my_catalog.my_schema.my_table;

4. Use Fully Qualified Table Names

SELECT * FROM my_catalog.my_schema.my_table;

Best Practices to Avoid SQL003 – Table Not Found

  1. Always use fully qualified table names (catalog.schema.table) to avoid confusion between Unity Catalog and Hive Metastore.
  2. Verify the table’s existence before querying.
  3. Grant necessary permissions to users and groups.
  4. Monitor table changes and metastore configurations.
  5. If using Delta Lake, check the Delta log history for recent table operations.

Conclusion

The SQL003 – Table Not Found error in Databricks usually results from misconfigured catalogs, incorrect table names, or missing permissions. By following these troubleshooting steps and best practices, you can quickly resolve the issue and ensure seamless querying in Databricks.

Related Posts

Z-ORDER in Databricks: Magic or Myth?

When it helps, when it hurts, how to pick columns, and what KPIs to measure. Introduction: Why the Hype Around Z-ORDER? If you’ve spent time in Databricks,…

Read More

Taming Small Files in Delta Lake

Optimal file sizes, compaction strategies, and how to keep your Delta tables lightning-fast Why Small Files Are a Big Problem Delta Lake is powerful, but it inherits…

Read More

Databrick Serverless compute plane networking

Here’s a simple line-by-line summary of the Serverless compute plane networking (08/04/2025): General idea Serverless egress control (outbound connections) Network Connectivity Configuration (NCC) What NCC enables: Extra…

Read More

Databrick Serverless compute limitations

Here’s a simple, line-by-line summary of the Serverless compute limitations (09/29/2025): General limitations Streaming limitations Machine learning limitations Notebook limitations Job limitations Compute-specific limitations Caching limitations Hive…

Read More

Best practices for Databrick serverless compute

Best practices for serverless compute Big picture Before you migrate Ingesting data (getting data in) Querying external data (without moving it) Spark configurations Watch your costs Quick…

Read More

Databrick Serverless compute release

Here’s a simple line-by-line summary of the important points from the Serverless Compute release notes (09/24/2025): Perfect 👍 Here’s a one-page cheat sheet table for the Serverless…

Read More
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x