简体   繁体   English

在 ADF V2 中使用什么变量表达式来获取数据集的名称

[英]What variable expression to use to fetch name of dataset in ADF V2

I have a dataset defined in ADF V2 of type Azure Storage.我在 ADF V2 中定义了一个 Azure 存储类型的数据集。 In the Connection we need to specify container and in my case the container is going to be the same as the name of the dataset itself.在连接中,我们需要指定容器,在我的情况下,容器将与数据集本身的名称相同。 Is there any way I can access name of the dataset dynamically?有什么方法可以动态访问数据集的名称吗? Because I would then like to clone this dataset and create many datasets with different names and in all the cases container name is going to be the same as their dataset names.因为我想克隆这个数据集并创建许多具有不同名称的数据集,并且在所有情况下,容器名称都将与其数据集名称相同。 I have tried accessing dataset name using @dataset().name and @dataset() also but it doesn't work.我也尝试使用 @dataset().name 和 @dataset() 访问数据集名称,但它不起作用。

在此处输入图像描述

Dhiraj, based on the System variables in ADF and Expressions and functions , there is no such expression like @dataset.name() or @dataset() . Dhiraj,基于ADFExpressions and functions中的系统变量,没有像@dataset.name()@dataset()这样的表达式。

However,you could try to use parameters with dataset to implement your needs.When you create your datasets,you know the name definitely.但是,您可以尝试使用带有数据集的参数来实现您的需求。当您创建数据集时,您肯定知道名称。 Please add that name as a default value parameter of dataset like this:请将该名称添加为数据集的默认值参数,如下所示:

在此处输入图像描述

Then you could refer to the value by using @dataset().selfName .(You could view this link: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#a-dataset-with-a-parameter )然后您可以使用@dataset().selfName引用该值。(您可以查看此链接: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language -functions#a-dataset-with-a-parameter )

在此处输入图像描述


My solution is also a hardcoding way because dataset name can't be referred in dataset inside so far as i found.我的解决方案也是一种硬编码方式,因为据我所知,数据集名称不能在数据集中引用。

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

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