Forum Discussion

dosuciu's avatar
dosuciu
Former Employee
Sep 10, 2021

Re: Inject column as parameter in a defined function inside a join

It seems to be By Design: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/functions/user-defined-functions#restrictions-on-the-use-of-user-defined-functions

A user-defined function belongs to one of two categories:

Scalar functions
Tabular functions, also known as views
The function's input arguments and output determine whether it is scalar or tabular, which then establishes how it might be used.

Scalar function
Has zero input arguments, or all its input arguments are scalar values
Produces a single scalar value
Can be used wherever a scalar expression is allowed
May only use the row context in which it is defined
Can only refer to tables (and views) that are in the accessible schema
Tabular function
Accepts one or more tabular input arguments, and zero or more scalar input arguments, and/or:
Produces a single tabular value

This explains why we cannot do this: May only use the row context in which it is defined
As soon as a scalar function tries to make a query beyond the "row context" it will fail.
That kinda sucks!!!
No RepliesBe the first to reply

Resources