microsoft / Kusto-Query-Language

Kusto Query Language is a simple and productive language for querying Big Data.
Apache License 2.0
510 stars 97 forks source link

Analysis should produce errors when not using aggregation functions after summarize #125

Closed davidnx closed 11 months ago

davidnx commented 1 year ago

Example query:

datatable(a:string, b:string) [
    'a', 'b',
    'c', 'd',
]
| summarize a by b

This query is obviously incorrect (notice that a is passed after summarize, instead of some aggregation function like take_any(a)). While this query indeed fails (as expected) when submitted to a real Kusto cluster, the Nuget package accepts this as valid and doesn't produce any diagnostics. Kusto Explorer also doesn't show any squiggles or issues for this query until I attempt to execute it.

Tested with Microsoft.Azure.Kusto.Language 11.3.1 (I couldn't test with 11.3.2 yet due to https://github.com/microsoft/Kusto-Query-Language/issues/124)

mattwar commented 1 year ago

Thanks for the report. You are correct. This should be an error.

mattwar commented 11 months ago

This has been fixed and should show up in the next release.