0
votes

As per the documentation - https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/reduceoperator

"reduce" operator returns a table with three columns (Pattern, Count, and Representative).

For example, the result of reduce by city might include:

TABLE 1
Pattern Count   Representative
San *   5182    San Bernard
Saint * 2846    Saint Lucy

Now what if I want to get some extra column with this result? Is there any way to do so? Basically I want to use that extra column as "foreignkey " for some other table.

Assuming that this is the limitation of "reduce" operator, so is there any way to get this result in a "TEMP Table", like in MSSQLServer we have a way to store an output of sql queriy into a #tempTable?

1

1 Answers

1
votes

At this moment 'reduce' operator does not allow carrying forward additional columns in its output. You may suggest and upvote such addition at https://aka.ms/adx.uservoice

If you have a sub-query that you would like to materialize for the query-lifetime: use materialize() function: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/materializefunction

For creating tables based on query results that can outlive specific query: you can use .set-or-append command: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/data-ingestion/ingest-from-query