Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@trzysiek
Copy link
Member

@trzysiek trzysiek commented Oct 29, 2024

So, this isn't a full solution.
Before we only knew how to handle filter(s) when they're leaves (or almost) in the aggregation tree.
Now we still can do that, but we also handle when they're the first aggregation layer (we just split them into multiple pancakes, with different WHERE)

I find it likely that we won't really need anything more, as those 2 cases exhaust both all our tests, and customer's case, so maybe it's hard to make a dashboard in Kibana with filter in the middle.

But anyway even if we want to support that, adding most top-level filter to where clause seems like a special case and would still be the way to go, so this PR should be a step forward.

@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch from 3edc8b0 to b125483 Compare October 29, 2024 17:00
@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch from 5e3ddc0 to d8b4f92 Compare October 30, 2024 10:18
@trzysiek trzysiek changed the title [WIP] Filter(s) 2nd approach Filter(s) 2nd approach Oct 30, 2024
@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch from 99e2438 to fc17222 Compare October 30, 2024 12:50
@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch 2 times, most recently from 4e2c855 to fe27c07 Compare October 30, 2024 12:57
Comment on lines 186 to +195
t1 := testName == "date_range aggregation(file:agg_req,nr:22)" // we use relative time
t2 := testName == "complex filters(file:agg_req,nr:18)" // almost, we differ in doc 0 counts
// to be deleted after pancakes
t3 := testName == "clients/kunkka/test_0, used to be broken before aggregations merge fix"+
t2 := testName == "clients/kunkka/test_0, used to be broken before aggregations merge fix"+
"Output more or less works, but is different and worse than what Elastic returns."+
"If it starts failing, maybe that's a good thing(file:clients/kunkka,nr:0)"
// below test is replacing it
// testName == "it's the same input as in previous test, but with the original output from Elastic."+
// "Skipped for now, as our response is different in 2 things: key_as_string date (probably not important) + we don't return 0's (e.g. doc_count: 0)."+
// "If we need clients/kunkka/test_0, used to be broken before aggregations merge fix"
return t1 || t2 || t3
return t1 || t2
Copy link
Member Author

@trzysiek trzysiek Oct 30, 2024

Choose a reason for hiding this comment

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

Seems like we're skipping more tests after this PR, but we actually skip one less (the one I remove here)

@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch from fe27c07 to d08a273 Compare October 30, 2024 13:02
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 31, 2024

Deploying quesma with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa4d576
Status: ✅  Deploy successful!
Preview URL: https://db0dca0a.quesma.pages.dev
Branch Preview URL: https://clover-filter-2nd-approach.quesma.pages.dev

View logs

@trzysiek trzysiek force-pushed the clover-filter-2nd-approach branch from 5453977 to aed1d92 Compare November 1, 2024 13:01
@trzysiek trzysiek marked this pull request as ready for review November 1, 2024 13:11
@trzysiek trzysiek requested a review from a team as a code owner November 1, 2024 13:11
@trzysiek trzysiek requested review from jakozaur and nablaone November 1, 2024 13:11
Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

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

Ok, that's good, we may wish to merge it anyway.

I'm still puzzled with this approach. Way better than previous one, but adding to top where might break total count as well as not work if it's inside. Instead, I would likely keep combinator logic, but just one filter per query each.

Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

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

Fine for now.

@trzysiek trzysiek added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit 4415532 Nov 4, 2024
5 checks passed
@trzysiek trzysiek deleted the clover-filter-2nd-approach branch November 4, 2024 11:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants