Skip to content

[ESQL] Enable "any type" aggregations on Date Nanos#114438

Merged
not-napoleon merged 11 commits intoelastic:mainfrom
not-napoleon:esql-min-max-date-nanos
Oct 24, 2024
Merged

[ESQL] Enable "any type" aggregations on Date Nanos#114438
not-napoleon merged 11 commits intoelastic:mainfrom
not-napoleon:esql-min-max-date-nanos

Conversation

@not-napoleon
Copy link
Copy Markdown
Member

@not-napoleon not-napoleon commented Oct 9, 2024

Resolves #110002
Resolves #110003
Resolves #110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.

@elasticsearchmachine elasticsearchmachine added v9.0.0 needs:triage Requires assignment of a team area label labels Oct 9, 2024
@not-napoleon not-napoleon added >non-issue :Analytics/ES|QL AKA ESQL v8.16.0 and removed needs:triage Requires assignment of a team area label labels Oct 9, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 9, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@not-napoleon not-napoleon changed the title [ESQL] Enable min and max aggregations on Date Nanos [ESQL] Enable "any type" aggregations on Date Nanos Oct 9, 2024
@not-napoleon not-napoleon added the test-release Trigger CI checks against release build label Oct 10, 2024
@not-napoleon
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@not-napoleon
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

 Conflicts:
	x-pack/plugin/esql/qa/testFixtures/src/main/resources/date_nanos.csv-spec
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java
@not-napoleon
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@not-napoleon not-napoleon added the auto-backport Automatically create backport pull requests when merged label Oct 24, 2024
@not-napoleon not-napoleon merged commit 889d2c3 into elastic:main Oct 24, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 114438

davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Oct 24, 2024
Resolves elastic#110002
Resolves elastic#110003
Resolves elastic#110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (elastic#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.


---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
not-napoleon added a commit to not-napoleon/elasticsearch that referenced this pull request Oct 24, 2024
Resolves elastic#110002
Resolves elastic#110003
Resolves elastic#110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (elastic#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
elasticsearchmachine pushed a commit that referenced this pull request Oct 24, 2024
…115558)

* [ESQL] Enable "any type" aggregations on Date Nanos (#114438)

Resolves #110002
Resolves #110003
Resolves #110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* not sure how that happened

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Oct 25, 2024
Resolves elastic#110002
Resolves elastic#110003
Resolves elastic#110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (elastic#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.


---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Nov 4, 2024
Resolves elastic#110002
Resolves elastic#110003
Resolves elastic#110005

Enable Values, Count, CountDistinct, Min and Max aggregations on date nanos. In the course of addressing this, I had to make some changes to AggregateMapper where it maps types into string names. I tried to refactor this once before (elastic#110841) but at the time we decided not to go ahead with it. That bit me while working on this, and so I am trying again to refactor it. This time I've made a more localized change, just replacing the cascading if block with a switch. That will cause a compile time failure when future new data types are added, unless they correctly update this section.

I've also done a small refactoring on the aggregators themselves, to make the supplier function consistent with the typeResolution.


---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged backport pending >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-release Trigger CI checks against release build v8.17.0 v9.0.0

Projects

None yet

5 participants