Need some help with Kusto (Azure Data Explorer).
Is it possible to convert this query into a materialized view?
customobject
| join kind=inner (
customobject
| summarize max_dp_adf_copy_start_time = max(dp_adf_copy_start_time) by accountId, id
)
on
$left.accountId == $right.accountId
and $left.id == $right.id
and $left.dp_adf_copy_start_time == $right.max_dp_adf_copy_start_time
I have tried this, but it comes back with Syntax Error Expected: )
:
.create materialized-view mvw_customobject on table customobject
{
customobject
| join kind=inner (
customobject
| summarize max_dp_adf_copy_start_time = max(dp_adf_copy_start_time) by accountId, id
)
on
$left.accountId == $right.accountId
and $left.id == $right.id
and $left.dp_adf_copy_start_time == $right.max_dp_adf_copy_start_time
}
Much help would be appreciated!
Best Regards 🙂
2
Answers
I found the solution. To get the result I was looking for, in Kusto (ADX) I did not need the join:
I have reproduced in my environment and below are my observations and followed Microsoft-Document:
I have got similar as you have at first:
Here, in yours and my query the problem was with summarize statement as summarize statement should come as last statement while creating the view and only one summarize statement should be used. When I made similar changes it got executed like below:
Example1:
Example2:
You can clearly check the document which I have provided, try to follow the examples and do it, you will get view created as I have got mine.