Search code examples
azure-databricksdatabricks-sql

Databricks Error: AnalysisException: [TABLE_OR_VIEW_NOT_FOUND] The table or view `mytable` cannot be found


When I attempt a select * from a VIEW in databricks I get the error:

AnalysisException: [TABLE_OR_VIEW_NOT_FOUND] The table or view `mytable` cannot be found. Verify the spelling and correctness of the schema and catalog

This strange because the table does exist see image below enter image description here

The sql query starts off as follows:

CREATE OR REPLACE TEMPORARY VIEW mytable AS

WITH cte_Umbrellas AS (
SELECT
  ud.umbrella_name as umbrella_name,
  ud.domicile_country_code 
FROM

And yet I don't get any errors with the following:

create or replace temporary view mynewview

as 

Select * from mytable

Any thoughts why I'm getting the error?


Solution

  • The screenshot you posted is how you would query the results of a view if you've previously defined it with a CREATE VIEW statement: SELECT * FROM view_name;

    It seems like you're trying to query the view some other way, but did not share it? Did you share the query you ran that caused the error?