Swasti
Swasti

Reputation: 287

Kusto Usecases (Nested User Defined Functions)

Could you please let me know if the following usecases can be handled in Kusto?

  1. Nested User defined queries (Can I call one function in the other function)?Here are the two functions
.create function  ifnotexists
with()
function1() {table1 | where column1 == abs}
.create function ifnotexists
with()
function2() {table2 | where column1 in (function1())}

Also How to add row level security policy to the nested function - function2()?The below does not seem to work

.alter table table2 policy row_level_security enable "function2"

2.How do I Upsert a row (Can I create a new table and migrate the schema). If so, Is it possible to make users have access to just the functions and not the underlying tables??

Note: I can write a function to point to a new table with upserted row

Upvotes: 0

Views: 774

Answers (1)

Alexander Sloutsky
Alexander Sloutsky

Reputation: 3027

  1. It is possible to use other functions inside a function. Nothing special - your example should work.

  2. Migrating table can be done with .set-or-append command: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/data-ingestion/ingest-from-query

  3. It is not possible to let user access functions only. Some scenarios of user-restriction can be solved with Row-level-security: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/rowlevelsecuritypolicy

  4. Some scenarios of "changing" rows can be done with "summarize arg_max(Time, *)" clause - where Time is the time of the update. https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/arg-max-aggfunction

Upvotes: 1

Related Questions