如何从数据流中访问管道参数? [英] How can I access pipeline parameters from data flow?

查看:111
本文介绍了如何从数据流中访问管道参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带参数的管道(类型为int)。在管道内部,我有一个数据流。此数据流需要引用此参数以便通过它过滤数据并将其添加为新的派生列。但是,从数据流中,我无法
来访问数据流本身所在的管道中定义的参数。

I have a pipeline with a parameter (type int). Inside the pipeline, at one point, I have a data flow. This data flow needs to reference this parameter in order to filter data by it and add it as a new derived column. However, from the data flow, I am unable to access the parameter defined in the pipeline in which the data flow itself resides.

管道:

{
    "name": "TestPipeline",
    "properties": {
        "activities": [
            {
                "name": "TestDataFlow",
                "type": "ExecuteDataFlow",
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "typeProperties": {
                    "dataflow": {
                        "referenceName": "TestDataFlow",
                        "type": "DataFlowReference"
                    }
                }
            }
        ],
        "parameters": {
            "CompanyId": {
                "type": "int",
                "defaultValue": 1
            }
        }
    }
}

数据流程:

{
    "name": "TestDataFlow",
    "properties": {
        "type": "MappingDataFlow",
        "typeProperties": {
            "sources": [
                {
                    "dataset": {
                        "referenceName": "DBEmployee",
                        "type": "DatasetReference"
                    },
                    "name": "Employees",
                    "script": "source(output(\n\t\tId as long,\n\t\tName as string,\n\t\tSurname as string,\n\t\tEmail as string,\n\t\tPosition as string\n\t),\n\tallowSchemaDrift: true,\n\tvalidateSchema: false,\n\tformat: 'table') ~> Employees"
                }
            ],
            "transformations": [
                {
                    "name": "AddColumnId",
                    "script": "Employees derive(ColumnId = ERROR_FUNCTION('@pipeline(__SINGLE_QUOTE__TestPipeline__SINGLE_QUOTE__).parameters.CompanyId')) ~> AddColumnId"
                }
            ]
        }
    }
}

我的查询是简单。如何访问管道的参数"CompanyId"?从数据流内部的转换?

My query is simple. How can I access the pipeline's parameter "CompanyId" from the transformations inside the dataflow?

谢谢!

推荐答案

您好Alan1096并感谢您的支持你的询问。 这是一个有趣的挑战。 我已经与产品组进行了交谈,目前不支持
管道参数,但很快就会推出。

Hello Alan1096 and thank you for your inquiry.  This has been an interesting challenge.  I have spoken to the product group, and pipeline parameters are currently not supported, but will be coming very soon.

数据集数据流当前支持参数。 我一直试图劫持数据集参数以便在更一般的意义上使用。 我认为可以做到,但到目前为止我没有太多运气。

The dataset parameters are currently supported in Data Flow.  I have been attempting to hijack the dataset parameters for use in a more general sense.  I think it can be done, but I have not had much luck so far.


这篇关于如何从数据流中访问管道参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆