Skip to content

Conversation

fang-xing-esql
Copy link
Member

@fang-xing-esql fang-xing-esql commented Jul 30, 2025

This is the second option to implement considering min/max from predicates when transform date_trunc/bucket to round_to. Instead of doing the transformation within each function by implementing LocalSurrogateExpression #131341 , this approach create a dedicated rule to transform date_trunc/bucket to round_to.

@elasticsearchmachine
Copy link
Collaborator

Hi @fang-xing-esql, I've created a changelog YAML for you.

@fang-xing-esql fang-xing-esql marked this pull request as ready for review July 30, 2025 14:16
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM
I think this is the better approach than the one of LocalSurrogateExpression. The code is easier to read/follow and the logic makes more sense like this. Thank you!

@fang-xing-esql
Copy link
Member Author

Thanks a lot for reviewing @astefan !

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

Progress!

I think it'd be nice to have the rule be pluggable in some way - there are other things we're going to do this with. But let's do that when have another one or two.

@fang-xing-esql fang-xing-esql merged commit afdd0b8 into elastic:main Aug 6, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants