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

Real Kusto widens int's to long's, Kusto.Language doesn't #68

Closed davidnx closed 2 years ago

davidnx commented 2 years ago

I found that even in trivial cases, real Kusto seems to widen int's to long's, which doesn't match Kusto.Language analysis behavior.

Something as simple as the Add operator illustrates this:

print v=int(1) + int(2)

Kusto.Language analysis of query indicates the result type is (v: int), but real Kusto produces (v:long) (verified using print v=gettype(int(1) + int(2))).

Are there docs to explain this behavior and whether this is expected or if it is a bug in the analyzer or in the engine?

Possibly related

See also: https://github.com/microsoft/Kusto-Query-Language/issues/67

The same kind of widening might be playing a role for a function call like bin(int(9), int(5)). Instead of produing int, real Kusto produces long. Not sure if arguments are always widened from int to long, or if the bin function simply isn't implemented for int inputs.

mattwar commented 2 years ago

It looks like there is a problem with promoting int's to longs for these cases. It will get fixed.

mattwar commented 2 years ago

This has been fixed.

davidni commented 2 years ago

@mattwar do you have an estimate when a new Nuget will be published with these changes? Latest released version 10.0.1 doesn't include the fix as far as I can tell. Thanks!