[英]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 池,我无法仅通过插入表名来创建链接服务:
Here are some official MS samples you can go through:以下是一些官方的 MS 样品,您可以通过 go:
Access data on Azure Data Lake Storage Gen2 (ADLS Gen2) with Synapse Spark 使用 Synapse Spark 访问 Azure Data Lake Storage Gen2 (ADLS Gen2) 上的数据
Access Synapse SQL table from Synapse Spark 从 Synapse Spark 访问 Synapse SQL 表
Further, refer: Bring data to a notebook此外,请参阅: 将数据带到笔记本
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.