Feature/count by trunc with filter#138765
Merged
GalLalouche merged 11 commits intoelastic:mainfrom Dec 11, 2025
Merged
Conversation
Collaborator
|
Hi @GalLalouche, I've created a changelog YAML for you. |
a801562 to
93e6a63
Compare
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Member
fang-xing-esql
left a comment
There was a problem hiding this comment.
Thank you @GalLalouche! I wonder if it would also be beneficial to merge filters on the RoundTo field for queries that don't have count?
...g/elasticsearch/xpack/esql/optimizer/rules/physical/local/PushCountQueryAndTagsToSource.java
Show resolved
Hide resolved
...g/elasticsearch/xpack/esql/optimizer/rules/physical/local/PushCountQueryAndTagsToSource.java
Outdated
Show resolved
Hide resolved
...g/elasticsearch/xpack/esql/optimizer/rules/physical/local/PushCountQueryAndTagsToSource.java
Show resolved
Hide resolved
Contributor
Author
Yeah, I agree, in fact, we can merge filters on any |
fang-xing-esql
approved these changes
Dec 10, 2025
Member
fang-xing-esql
left a comment
There was a problem hiding this comment.
LGTM, thank you @GalLalouche !
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Dec 11, 2025
* upstream/main: (79 commits)
Mute org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT test {p0=search/140_pre_filter_search_shards/prefilter on non-indexed date fields} elastic#139381
Adjust error bounds for bfloat16 value checks (elastic#139371)
Unmute some vector CSS tests (elastic#139370)
Do not allow `project_routing` as a query param (elastic#139206)
Unmute HalfFloat...Tests#testSynthesizeArrayRandom (elastic#139341)
Remove leniency in LinkedProjectConfig builder methods (elastic#139012)
EQL: fix project_routing (elastic#139366)
Add patch version for 9.2 index version constant (elastic#139362)
Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search.vectors/200_dense_vector_docvalue_fields/dense_vector docvalues with bfloat16} elastic#139368
ES|QL: Enable CCS tests for FORK (elastic#139302)
Restructuring the semantic_text field type page (elastic#138571)
AggregateMetricDouble fields should not build BKD indexes (elastic#138724)
Feature/count by trunc with filter (elastic#138765)
ESQL: Convert TS 500 error to 400 (elastic#139360)
[CI] Rerun failing tests for periodic build pipelines (elastic#139200)
revert muting saml test (elastic#139327)
Add TDigest histogram as metric (elastic#139247)
Links solved bugs to class cast exception changelog and unmutes errors (elastic#139340)
Ensure integer sorts are rewritten to long sorts for BWC indexes (elastic#139293)
Integrate stored fields format bloom filter with synthetic _id (elastic#138515)
...
Merged
GalLalouche
added a commit
that referenced
this pull request
Jan 19, 2026
This PR adds golden tests to ES|QL! ● I added a GoldenTestsReadme.md with instructions on how to add new golden tests. ● I tried to keep this (relatively) minimal for the first PR. In the future we can add more features, configurations, stages (e.g., local node_reduce), etc. ● As a proof of concept, I've re-implemented (most) of the tests in SubstitudeRoundToTests using the golden testing framework. ○ When I recently worked on these tests (#138023,#138765), the majority of my time was spent mechanically fixing the expected output in the tests. ○ This was a good use case since I needed to add more support for test nesting due to the loops in the original tests. ○ While more text is being produced when using golden tests (70k lines!), fixing the expected output is a lot simpler, since you can just bulldoze the output! In this case, eyeballing the difference is enough to be convinced that the change is correct. So the maintenance cost goes down. ○ One of the tests (testRoundToWithTimeSeriesIndices) was skipped because its output isn't actually consistent across runs. The original test only verifies a very specific subset of the AST, so it's not a good candidate for golden tests.
spinscale
pushed a commit
to spinscale/elasticsearch
that referenced
this pull request
Jan 21, 2026
This PR adds golden tests to ES|QL! ● I added a GoldenTestsReadme.md with instructions on how to add new golden tests. ● I tried to keep this (relatively) minimal for the first PR. In the future we can add more features, configurations, stages (e.g., local node_reduce), etc. ● As a proof of concept, I've re-implemented (most) of the tests in SubstitudeRoundToTests using the golden testing framework. ○ When I recently worked on these tests (elastic#138023,elastic#138765), the majority of my time was spent mechanically fixing the expected output in the tests. ○ This was a good use case since I needed to add more support for test nesting due to the loops in the original tests. ○ While more text is being produced when using golden tests (70k lines!), fixing the expected output is a lot simpler, since you can just bulldoze the output! In this case, eyeballing the difference is enough to be convinced that the change is correct. So the maintenance cost goes down. ○ One of the tests (testRoundToWithTimeSeriesIndices) was skipped because its output isn't actually consistent across runs. The original test only verifies a very specific subset of the AST, so it's not a good candidate for golden tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds filter support for pushing down
COUNT(*) BY DATE_TRUNCintroduced in #138023, i.e.,Note that we still won't push down queries where the filter is on the
COUNT(*)since that case is a lot more complicated due to having to keep zeros for filtered buckets: