如何在Azure Databricks笔记本中调试长时间运行的python命令?

问题描述 投票:0回答:1

我正在学习本教程:https://docs.microsoft.com/en-us/academic-services/graph/tutorial-azure-databricks-hindex

我已经完全访问了Microsoft Academic Graph数据集,并希望根据该数据集发布一些基本的pySpark代码。

例如,此代码:

# Get affiliations
Affiliations = MAG.getDataframe('Affiliations')
Affiliations = Affiliations.select(Affiliations.AffiliationId, Affiliations.DisplayName)
Affiliations.show(3)

[当我使用'Shift + Enter'运行代码时,它进入'运行命令'的状态-甚至在半小时后也似乎从未完成。我已为此插入了屏幕截图,并附加到我的帖子中。

我分别运行了这些命令,这是导致运行缓慢的最后一个(Affiliations.show(3))。

例如,当我自己运行命令(Affiliations = MAG.getDataframe('Affiliations'))时,实际上得到的结果是:

AffiliationId:long
Rank:integer
NormalizedName:string
DisplayName:string
GridId:string
OfficialPage:string
WikiPage:string
PaperCount:long
CitationCount:long
Latitude:float
Longitude:float
CreatedDate:date

问题:如何调试它以找出导致速度慢的原因?

enter image description here

python azure pyspark azure-databricks pyspark-dataframes
1个回答
0
投票

在笔记本环境中,调试分布式应用程序仍然很困难。即使网络用户界面具有必要的信息,但网络用户界面与开发环境之间仍然存在差距:通常很难在网络用户界面中找到与您要研究的代码相关的信息;而且没有找到历史运行时信息的简便方法。

在笔记本环境中,调试分布式应用程序仍然很困难。即使网络用户界面具有必要的信息,但网络用户界面与开发环境之间仍然存在差距:通常很难在网络用户界面中找到与您要研究的代码相关的信息;而且没有找到历史运行时信息的简便方法。

enter image description here

了解如何使用Databricks Spark UI进行调试:

Spark UI包含大量信息,可用于调试Spark作业。有很多很棒的可视化,我们在这里有关于这些功能的博客文章。

enter image description here

有关更多详细信息,请单击Jobx视图(阶段):

enter image description here

参考: Tips to Debug Apache Spark UI with Databricks

希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.