你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

invoke 运算符

调用一个 lambda 表达式,该表达式接收 invoke 的源作为表格参数。

注意

若要更详细地了解如何声明可接受表格参数的 lambda 表达式,请参阅 let 语句

语法

T| invokefunction([param1,param2])

详细了解语法约定

参数

名称 类型 必需 说明
T string ✔️ 表格源。
函数 string ✔️ 要计算的 lambda let 表达式的名称或存储函数名称。
param1, param2 ... string 要传递给函数的任何其他 lambda 参数。

返回

返回已计算的表达式的结果。

示例

下面的示例演示如何使用 invoke 运算符来调用 lambda let 表达式:

// clipped_average(): calculates percentiles limits, and then makes another 
//                    pass over the data to calculate average with values inside the percentiles
let clipped_average = (T:(x: long), lowPercentile:double, upPercentile:double)
{
   let high = toscalar(T | summarize percentiles(x, upPercentile));
   let low = toscalar(T | summarize percentiles(x, lowPercentile));
   T 
   | where x > low and x < high
   | summarize avg(x) 
};
range x from 1 to 100 step 1
| invoke clipped_average(5, 99)

输出

avg_x
52