Skip to content

Wrong return type for subtract between DateTime and Timespan #182

@faridmehrhesam

Description

@faridmehrhesam

Consider writing following KQL

print datetime('2025-01-01 00:05:00') - dynamic(3m)
| extend  type = gettype(print_0)

the result is:

Image

but using KustoCode.ParseAndAnalyze will result in ResultType of the last QueryOperator to be:

Image

Which is wrong as print_0 column needs to be of timespan type, looking into the code found issue to be return type of the Subtract in Kusto.Language.Operators:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions