简体   繁体   English

Azure 数据工厂 - 查找活动:使用 In 运算符过滤 Azure 表存储查询

[英]Azure Data Factory - Lookup Activity: Filtering Azure Table Storage query with In operator

I created a Azure Table storage with this format:我用这种格式创建了一个 Azure 表存储:

ID ID Table桌子
1 1 table1表格1
2 2 table2表2
3 3 table3表3
4 4 table4表4

and in the DataFactory I want to create a query using this table filtering with the IN operator, for example: ID in ('1', '2')在 DataFactory 中,我想使用带有 IN 运算符的表过滤创建一个查询,例如: ID in ('1', '2')

I'm using a Lookup Activity and I created this array parameter: array parameter我正在使用查找活动并创建了这个数组参数:数组参数

and I want to use it in the query, for example: @ID in pipeline().parameters.Id image: data factory - lookup activity query我想在查询中使用它,例如: @ID in pipeline().parameters.Id image: data factory - 查找活动查询

Does anyone know a way to filter and help?有谁知道过滤和帮助的方法? Thanks!谢谢!

AFAIK , Currently IN and Contains are not supported in Azure Table Storage Queries. Azure 表存储查询不支持AFAIK ,Currently INContains

If your array values are less, you can directly give the query like Id eq '1' or Id eq '2' in lookup which will give the following result.如果您的数组值较小,您可以在查找中直接给出Id eq '1' or Id eq '2'类的查询,这将给出以下结果。

在此处输入图像描述

If your array is large, you can try the below approach using a ForEach.如果您的数组很大,您可以使用 ForEach 尝试以下方法。

Lookup activity:查找活动:

在此处输入图像描述

ForEach:对于每个:

Give the Lookup output value.给出查找 output 值。

在此处输入图像描述

Inside ForEach Store the item() in a variable as string:在 ForEach 中,将item()作为字符串存储在变量中:

在此处输入图像描述

Inside if condition give the following expression:在 if 条件中给出以下表达式:

@contains(pipeline().parameters.arr,item().Id)

Here arr is an array parameter with ["1","2"] values.这里arr是一个具有["1","2"]值的数组参数。

在此处输入图像描述

In true activities append the Variable value to an array variable:在真实活动中 append 将变量值转换为数组变量:

在此处输入图像描述

Result stored in another variable from res1 variable (optional and only for showing result here):结果存储在res1变量的另一个变量中(可选,仅用于在此处显示结果):

在此处输入图像描述

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

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