Bug: Shallow Clone `create or replace` causing [TABLE_OR_VIEW_NOT_FOUND]

stevenayers-bge
Contributor

I am having an issue where when I do a shallow clone using :

create or replace table `catalog_a_test`.`schema_a`.`table_a` shallow clone `catalog_a`.`schema_a`.`table_a`
 
I get:
[TABLE_OR_VIEW_NOT_FOUND] The table or view catalog_a_test.schema_a.table_a 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. SQLSTATE: 42P01
 
As you can see it's throwing an error related to the new cloned table. The weird bit is, the command does create the table.

Omar_hamdan
Databricks Employee
Databricks Employee

Hi Steven
This is really a strange issue. First let's exclude some possible causes for this. We need to check the following:
- The permission to table A and Catalog B. take a look at the following link to check what permission is needed: https://docs.databricks.com/en/delta/clone-unity-catalog.html
- the cluster you are using to clone is a unity catalog enabled cluster.
- Just to make sure is the "Destination" Table not found or the "Source"
Hopefully by checking those we can figure out why this is happening. 

 

Hi Omar 👋

I checked those things out and everything seems to be in order. I also spun up a new warehouse and could reproduce the issue.

I was able to resolve the issue by downgrading our warehouse from the “Preview” Channel to “Current” Channel, which may mean there has been a bug introduced into the “Preview” Channel. 

The release notes for Databricks SQL release notes say that both channels use 2024.15, but maybe there’s been a minor version release in “Preview” channel that’s triggered the issue?

Hi Steven

Thanks for checking out all the recommended options. I tried to reproduce the error and was not successful. Using both channel preview and current I was able to create a shallow clone of a table. However the channel version for me is 2024.25.
So it might be a hiccup in the 2024.15 preview, but it is resolved in the 2024.25 which soon should be in your region. 
Thanks for flagging this up.

Hi @Omar_hamdan,

I'm now experiencing this error in both preview and current channels (2024.25). Is there a way I can rollback my SQL Warehouse Version until this is resolved?