简体   繁体   English

我如何在PySpark笔记本中读取Azure Synapse中的Lake数据库

[英]How Do i read the Lake database in Azure Synapse in a PySpark notebook

Hi I created a Database in Azure Synapse Studio and I can see the database and table in there, Now I have created a Notebook where I have added the required libraries but I am unable to read the table by below code.您好,我在 Azure Synapse Studio 中创建了一个数据库,我可以在其中看到数据库和表格,现在我创建了一个笔记本,其中添加了所需的库,但我无法通过以下代码读取表格。 Can anyone fix what wrong am i doing here?谁能解决我在这里做错了什么?

My database name is Utilities_66_Demo .我的数据库名称是Utilities_66_Demo It gives me error as它给了我错误

AnalysisException: Path does not exist: abfss://users@stcdmsynapsedev01.dfs.core.windows.net/Utilities_66_Demo.parquet AnalysisException:路径不存在:abfss://users@stcdmsynapsedev01.dfs.core.windows.net/Utilities_66_Demo.parquet

From where should I take the path?我应该从哪里走这条路? I tried to follow the MS article .我试图按照 MS 文章进行操作。 Where Do I read path?我在哪里阅读路径? if I click on edit Database, i get this如果我点击编辑数据库,我会得到这个

在此处输入图像描述

%%pyspark
df = spark.read.load('abfss://users@stcdmsynapsedev01.dfs.core.windows.net/Utilities_66_Demo.parquet', format='parquet')
display(df.limit(10))

Trying to access the created Lake Database Table: Selected Azure Synapse Analytics:尝试访问创建的 Lake 数据库表:已选择 Azure Synapse Analytics:

在此处输入图像描述

I select my workspace and in dropdown there is no table shown:我 select 我的工作区,在下拉列表中没有显示表格:

在此处输入图像描述

I select Edit and put my Db name and Table name and it says Invalid details.我 select 编辑并输入我的 Db 名称和表名称,它显示无效详细信息。

Now I select Azure Dedicated Synapse Pool from Linked Service ,现在我 select Azure 来自链接服务的专用突触池

I get no option to select in SQL Pool or Table, and without SQL Pool I am unable to create a Linked service just by inserting Table name:我没有选择 SQL 池或表中的 select,如果没有 SQL 池,我无法仅通过插入表名来创建链接服务:

在此处输入图像描述

You can directly go to your ADLS and right click the parquet file and select properties.您可以直接 go 到您的 ADLS 并右键单击镶木地板文件和 select 属性。 There, you will be able to find the ABFSS path which is in the format: abfss://<container_name>@<storage_account_name>.dfs.core.windows.net/<path在那里,您将能够找到格式如下的 ABFSS 路径: abfss://<container_name>@<storage_account_name>.dfs.core.windows.net/<path

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不使用 Spark 的情况下从 Synapse 笔记本中的 Azure 数据湖读取 XML 文件 - How To Read XML File from Azure Data Lake In Synapse Notebook without Using Spark 如何在 Azure Synapse Serverless 池中为 Lake 数据库创建视图 - How to create view in Azure Synapse Serverless pool for a Lake Database Azure Synapse 笔记本读取变量 - Azure Synapse Notebook Read Variable Azure Synapse中Delta Lake和Lake Database的区别 - Difference between Delta Lake and Lake Database in Azure Synapse 如何生成 Azure Synapse Pathways 所需的 DDL 文件 - How do I generate the DDL file need for Azure Synapse Pathways Synapse pyspark - 在 Azure SQL 数据库上执行存储过程? - Synapse pyspark - execute stored procedure on Azure SQL Database? Dataverse 到 Synapse 链接 - Workspace 中缺少 Lake 数据库 - Dataverse to Synapse Link - missing Lake database in Workspace Synapse Lake 数据库视图在 SQL 池中不可用? - Synapse Lake database view not available in SQL Pool? Azure Synapse Serverless SQL 池 - 如何优化笔记本 - Azure Synapse Serverless SQL Pools - how to optimize notebook 如何使用 SQLAlchemy 将数据插入 Azure Synapse 数据库 - How to insert data into Azure Synapse Database with SQLAlchemy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM