Skip to content
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

Fix ids query DSL #1135

Merged
merged 4 commits into from
Dec 23, 2024
Merged

Fix ids query DSL #1135

merged 4 commits into from
Dec 23, 2024

Conversation

trzysiek
Copy link
Member

@trzysiek trzysiek commented Dec 21, 2024

By accident I noticed our SQL generated for ids looks quite nonsensical, e.g. that's what's generated for my new very simple request:

WHERE "@timestamp" IN toDateTime64('2024-12-21 07:29:03.367', '2024-12-21 07:29:02.992', 3)

Also noticed we have 0 tests for this query. Fixing those 2 things here.
(adding TupleExpr for just this 1 usecase might seem unnecessary, but it's needed in my 2 other open PRs, so I'd do that)

Also, minor: changed return model.NewSimpleQuery(nil, false) to more descriptive return model.NewSimpleQueryInvalid() everywhere.

@trzysiek trzysiek marked this pull request as ready for review December 21, 2024 08:33
@trzysiek trzysiek requested a review from a team as a code owner December 21, 2024 08:33
@trzysiek trzysiek enabled auto-merge December 21, 2024 08:43
switch len(t.Exprs) {
case 0:
logger.WarnWithThrottling("VisitTuple", "TupleExpr with no expressions")
return "()"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be consistent, consider returning tuple()

@pdelewski
Copy link
Contributor

LGTM :)

@trzysiek trzysiek added this pull request to the merge queue Dec 23, 2024
Merged via the queue into main with commit cf0fd3f Dec 23, 2024
5 checks passed
@trzysiek trzysiek deleted the fix-ids branch December 23, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants