简体   繁体   中英

Azure Synapse Lake Database - Notebook cannot access information_schema

In Synapse Analytics I can write the following SQL script and it works fine:

SELECT Table_name FROM dataverse_blob_blob.information_schema.tables WHERE Table_name NOT LIKE '%_partitioned' ORDER BY 1

I am trying to do the same using a Notebook:

%%sql
SELECT Table_name FROM `dataverse_blob_blob`.`information_schema`.`tables`

And it throws the error: Error: spark_catalog requires a single-part namespace, but got [dataverse_blob_blob, information_schema]

Tried using USE CATALOG and USE SCHEMA to set the catalog/schema but that throws an error too.

I have reproduced this in my environment and got below results.

I have created a serverless SQL database named as mydb .

在此处输入图像描述

I tried to execute your command in Synapse notebook, and I got same error.

在此处输入图像描述

As commented by @Joel Cochran The spark pools does not have access to the Serverless SQL database and it is same for Lake databases also as those can be executed by serverless pools. Thats why it is giving the above error.

If you want to get those in notebooks, try to copy them into a ADLS or blob and then using mounting you can access those in spark.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM