代码之家  ›  专栏  ›  技术社区  ›  Anders Sewerin Johansen

我可以在自定义函数中使用表格参数吗

  •  0
  • Anders Sewerin Johansen  · 技术社区  · 6 年前

    基本上我想把一组字段值传递给一个函数,这样我就可以在/!在运算符中。我更希望能够使用上一个查询的结果,而不是必须手动构造一个集合。

    let today = exception | where EventInfo_Time > ago(1d) | project exceptionMessage;
    MyAnalyzeFunction(today)
    

    那么MyAnalyzeFunction的签名是什么?

    1 回复  |  直到 5 年前
        1
  •  4
  •   Yoni L.    6 年前

    请参见: https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions

    例如,下面的语句将返回一个只有一列的表( y )与价值观 2 3

    let someTable = range x from 2 to 10 step 1
    ;
    let F = (T:(x:long)) 
    {
        range y from 1 to 3 step 1
        | where y in (T)
    }
    ;
    F(someTable)
    
    推荐文章