【问题标题】:Azure Data Factory V2 - Input and OutputAzure 数据工厂 V2 - 输入和输出
【发布时间】:2020-03-06 16:19:44
【问题描述】:

我正在尝试基于以下 github 存储库重现以下架构:https://github.com/Azure/cortana-intelligence-price-optimization

问题是链接到 ADF 的部分,因为在指南中它使用旧版本的 ADF:我不知道如何在 ADF v2 中映射单个活动的“输入”和“输出”属性,所以它们指向一个数据集。

管道执行一个 spark 活动,它只执行一个 python 脚本,然后我认为它应该将数据写入我已经定义的数据集中。

这是指南中 ADF V1 管道的 json,我无法复制:

    "activities": [
    {
      "type": "HDInsightSpark",
      "typeProperties": {
        "rootPath": "adflibs",
        "entryFilePath": "Sales_Data_Aggregation_2.0_blob.py",
        "arguments": [ "modelsample" ],
        "getDebugInfo": "Always"
      },
      "outputs": [
        {
          "name": "BlobStoreAggOutput"
        }
      ],
      "policy": {
        "timeout": "00:30:00",
        "concurrency": 1,
        "retry": 1
      },
      "scheduler": {
        "frequency": "Hour",
        "interval": 1
      },
      "name": "AggDataSparkJob",
      "description": "Submits a Spark Job",
      "linkedServiceName": "HDInsightLinkedService"
    },

【问题讨论】:

    标签: azure pipeline azure-data-factory azure-hdinsight azure-data-factory-2


    【解决方案1】:

    数据工厂管道中的 Spark 活动在您自己的或按需 HDInsight 群集上执行 Spark 程序。此article 建立在数据转换活动文章的基础上,该文章提供了数据转换和支持的转换活动的一般概述。当您使用按需 Spark 链接服务时,数据工厂会自动为您创建一个 Spark 集群,以便及时处理数据,然后在处理完成后删除该集群。

    将“Sales_Data_Aggregation_2.0_blob.py”上传到附加到 HDInsight 群集的存储帐户,并修改 spark 活动的示例定义并创建计划触发器并运行代码:

    以下是 Spark 活动的示例 JSON 定义:

     {
        "name": "Spark Activity",
        "description": "Description",
        "type": "HDInsightSpark",
        "linkedServiceName": {
            "referenceName": "MyHDInsightLinkedService",
            "type": "LinkedServiceReference"
        },
        "typeProperties": {
            "sparkJobLinkedService": {
                "referenceName": "MyAzureStorageLinkedService",
                "type": "LinkedServiceReference"
            },
            "rootPath": "adfspark",
            "entryFilePath": "test.py",
            "sparkConfig": {
                "ConfigItem1": "Value"
            },
            "getDebugInfo": "Failure",
            "arguments": [
                "SampleHadoopJobArgument1"
            ]
        }
    }
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 2018-04-08
      • 2019-10-28
      • 1970-01-01
      • 2019-03-01
      • 1970-01-01
      • 2018-10-29
      • 1970-01-01
      相关资源
      最近更新 更多