简体   繁体   中英

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

I created a Azure Table storage with this format:

ID Table
1 table1
2 table2
3 table3
4 table4

and in the DataFactory I want to create a query using this table filtering with the IN operator, for example: 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

Does anyone know a way to filter and help? Thanks!

AFAIK , Currently IN and Contains are not supported in Azure Table Storage Queries.

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.

在此处输入图像描述

If your array is large, you can try the below approach using a ForEach.

Lookup activity:

在此处输入图像描述

ForEach:

Give the Lookup output value.

在此处输入图像描述

Inside ForEach Store the item() in a variable as string:

在此处输入图像描述

Inside if condition give the following expression:

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

Here arr is an array parameter with ["1","2"] values.

在此处输入图像描述

In true activities append the Variable value to an array variable:

在此处输入图像描述

Result stored in another variable from res1 variable (optional and only for showing result here):

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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