-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[full-ci] enhancement: add more kql spec tests and simplify ast normalization #7254
Conversation
48d9ced
to
3421942
Compare
…Restriction queries
3421942
to
ed19e7a
Compare
It is not related to code.
Why do two equal expressions become different? |
Which is reducable. Isn't it? |
@2403905, writing from my mobile, I hope it makes sense, to be exact, the docs say
are the same, which translates to:
we will never be able to translate to the exact same query from the docs, but we can creat queries that mean the same. but i wonder too, I expect
when reading reading
and we do:
i picked the one that made most sense, but thanks for birds eyes, we could discuss it together, i expect it's a typo in the docs, makes no sense to me at all.
|
@2403905 i had to touch the parser again, thanks to @ScharfViktor ive found a bug in which child nodes were linked with an OR instead of an AND, i found the part in the docs, implemented it and we now can decide on a node bases how connecting edges get handled. still, the sound strange to me, but i hope the spec is correct:
is the same as
but
is the same as
but what about
is it?
or is it?
we now have
wich sounds good to me, what do you all mean? |
connecting nodes (with edges) seem straight forward when not using group, the default connection for nodes with the same node is always OR. THis only applies for first level nodes, for grouped nodes it is defined differently. The KQL docs are saying, nodes inside a grouped node, with the same key are connected by a AND edge.
2d1ccb7
to
824bdd4
Compare
…s with leading binary operator
also some optimizations down the road. Before:
After:
|
93970cc
to
76b83df
Compare
7dfe798
to
63cdc20
Compare
Kudos, SonarCloud Quality Gate passed! |
…lization (#7254) * enhancement: add more kql spec tests and simplify ast normalization * enhancement: kql parser error if query starts with AND * enhancement: add kql docs and support for date and time only dateTimeRestriction queries * enhancement: add the ability to decide how kql nodes get connected connecting nodes (with edges) seem straight forward when not using group, the default connection for nodes with the same node is always OR. THis only applies for first level nodes, for grouped nodes it is defined differently. The KQL docs are saying, nodes inside a grouped node, with the same key are connected by a AND edge. * enhancement: explicit error handling for falsy group nodes and queries with leading binary operator * enhancement: use optimized grammar for kql parser and toolify pigeon * enhancement: simplify error handling * fix: kql implicit 'AND' and 'OR' follows the ms html spec instead of the pdf spec
Description
follow up pr for the ocis kql integration, @butonic found a ms pdf spec which contains even more detail than the KQL docs page.
https://msopenspecs.azureedge.net/files/MS-KQL/%5bMS-KQL%5d.pdf
With that in mind, it looks we understood (or tried to ;)) some parts of the implicit operator node connections wrong.
There are still some parts of which contradict each other, but most of that should be now spec compliant.
following queries are now exactly covered as described in the spec:
beside that it also includes:
-
and+
bool operatorsRelated Issue
Motivation and Context
with the found spec, it's more clear how some parts are connected to each other, as we said KQL will be our primary query language, therefore we should respect the spec as good as we can.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: