如何从 Apache Airflow 触发 azure Databricks notebook

How to trigger azure Databricks notebook from Apache Airflow

我在 Azure 数据块笔记本中创建了一些 ETL。 现在尝试从 airflow-1.10.10 执行该笔记本。

如果有人能帮忙就太好了。

提前致谢。

气流includes native integration with Databricks, that provides 2 operators: DatabricksRunNowOperator & DatabricksSubmitRunOperator (package name is different depending on the version of Airflow. There is also an example of how it could be used.

您需要创建一个名称为 databricks_default 的连接,其中包含用于安排您的作业的登录参数。在最简单的情况下,对于作业,您只需要提供集群的定义和笔记本规格(至少笔记本的路径到 运行),如下所示:

    notebook_task_params = {
        'new_cluster': new_cluster,
        'notebook_task': {
            'notebook_path': '/Users/airflow@example.com/PrepareData',
        },
    }
    # Example of using the JSON parameter to initialize the operator.
    notebook_task = DatabricksSubmitRunOperator(
        task_id='notebook_task',
        json=notebook_task_params
    )

P.S。有一个 old blog post 宣布了此集成。