Hi Tom,
Ah, that implicit type conversion performance hit is a classic ADF data flow challenge )) when you're dealing with large datasets, that string comparison against integer columns can really slow things down.
Instead of letting ADF implicitly convert your integer column to string, explicitly convert the string array parameter to integers within the data flow. This way, the comparison happens between integer types, which is much faster.
In your data flow, add a derived column transformation before your filter. Use the toInteger() function to convert your string array parameter values to integers. Something like
toInteger(byPosition($CustomerIDFilter, 0)) But since you're dealing with an array, you'll need to handle this differently. Create a separate data flow parameter of type integer array, then map your pipeline string array parameter to this data flow parameter using integer conversion in the pipeline expression.
In your pipeline, when calling the data flow, use
@convert(stringArrayParameter, 'integer') Then in your data flow filter, you can compare integer to integer
isMatch(integerColumn, $integerArrayParameter) The ADF data flow expression documentation shows the type conversion functions available https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expression-functions.
Another approach is to use the in function with explicit casting
in(integerColumn, $stringArrayParameter) But honestly, the integer array approach will perform better because it avoids any runtime type conversions during the filter operation.
If you're dealing with a very large array of values, consider using a lookup activity to get the integer values from a database or storage, then pass those directly to your data flow as integers.
You could also break this into two data flows - one that handles the type conversion and creates a temporary dataset, then a second that performs the integer-to-integer filtering.
regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer