Azure ADF表达式基于布尔返回一个现有数组或一个空数组 [英] Azure ADF expression that returns either an existing array, or an empty array, based on a bool

查看:94
本文介绍了Azure ADF表达式基于布尔返回一个现有数组或一个空数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个布尔表达式:equals(myStringValue, targetStringValue)

I have a boolean expression: equals(myStringValue, targetStringValue)

我有一个可能无效的数组表达式,具体取决于布尔条件myArrayExpression.

I have an array expression which might or might not be valid, depending on the boolean condition myArrayExpression.

我要写:

if(
  equals(myStringValue, targetStringValue),
  myArrayExpression,
  ?????
)

其中?????是一个返回空数组的表达式.

where ????? is an expression that returns an empty array.

自然地,这是一个XY问题. 我当然想直接知道如何做到这一点,因为了解这种语言的工作方式对我很重要.但是,如果您想了解XY问题,请访问此处:如果文件夹可能不存在,请Azure ADF GetMetadata子项

Naturally, this is an XY-problem. I definitely want to know how to do this directly, because understanding how this language works well is important to me. But if you want to know about the XY problem, it's over here: Azure ADF GetMetadata childItems if folder might not exist

推荐答案

定义一个没有默认值的数组变量,然后对其进行引用.

Defining an array variable, with no default value, and then referencing that does work.

但是似乎很可悲-现在我们无缘无故地在浮动一个额外的变量:(

But seems very sad - now we've got an extra variable floating around for no reason :(

这篇关于Azure ADF表达式基于布尔返回一个现有数组或一个空数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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