简体   繁体   English

Azure Databricks 与 Python 脚本

[英]Azure Databricks with Python scripts

I am new to Python.我是 Python 的新手。 Need help with Azure databricks.在 Azure 数据块方面需要帮助。

Scenario:设想:

Currently I am working on a project which uses HDInsight cluster to submit spark jobs and they use Python script with classes and functions [.py] which resides in the /bin/ folder in the edge node.目前我正在开发一个使用 HDInsight 集群提交 Spark 作业的项目,他们使用 Python 脚本和位于边缘节点 /bin/ 文件夹中的类和函数 [.py]。

We propose to use Databricks instead of HDInsight cluster and the PoC requires minimum effort.我们建议使用 Databricks 而不是 HDInsight 群集,并且 PoC 需要最少的工作量。

Doubts:疑点:

  1. In the HDInsight cluster all the python scripts are stored in /bin/ folder and conf files with.yml in /conf/ folder.在 HDInsight 群集中,所有 python 脚本都存储在 /bin/ 文件夹中,带有 .yml 的 conf 文件存储在 /conf/ 文件夹中。

Can we replicate the same structure in the databricks DBFS so that minimum changes in the code to replicate the location.我们能否在 databricks DBFS 中复制相同的结构,从而使复制位置的代码更改最少。

2.I am new to Python, I have a bunch of scripts in the /bin/ folder. 2.我是 Python 的新手,我在 /bin/ 文件夹中有一堆脚本。 How can I upload or install those scripts in databricks.如何在数据块中上传或安装这些脚本。

My assumption is, I need to create a package and install on the cluster as a library.我的假设是,我需要创建一个 package 并作为库安装在集群上。 Correct me if I am wrong.如果我错了,请纠正我。

  1. How do I run the Python scripts from Databricks.如何从 Databricks 运行 Python 脚本。

@Sathya Can you provide more information on what the different python scripts as well as the config files do? @Sathya 您能否提供有关不同 python 脚本以及配置文件的作用的更多信息?

As for the python scripts, depending on what their function is, you could create one or more python notebooks in Databricks and copy the contents into them.至于 python 脚本,根据它们的 function 是什么,您可以在 Databricks 中创建一个或多个 python 笔记本并将内容复制到其中。 You can then run these notebooks as part of a job or reference them in other notebooks with %run /path/to/notebook然后,您可以将这些笔记本作为作业的一部分运行,或者使用%run /path/to/notebook在其他笔记本中引用它们

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

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