[ESQL] Support date_nanos on functions that take "any" type#114056
[ESQL] Support date_nanos on functions that take "any" type#114056not-napoleon merged 17 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
I've intentionally left the meta tests failing because I don't want to fix them here if we're about to drop them in #113967. If we decide not to go ahead with that, I can update the expected function definition checks in this PR. |
Conflicts: 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/scalar/conditional/Greatest.java x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestTests.java x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastTests.java
Conflicts: x-pack/plugin/esql/qa/testFixtures/src/main/resources/meta.csv-spec
astefan
left a comment
There was a problem hiding this comment.
LGTM
Worth adding test-release label to the PR or you are confident enough that it's ok without this check?
| return new GreatestIntEvaluator.Factory(source(), factories); | ||
| } | ||
| if (dataType == DataType.LONG || dataType == DataType.DATETIME) { | ||
| if (dataType == DataType.LONG || dataType == DataType.DATETIME || dataType == DataType.DATE_NANOS) { |
There was a problem hiding this comment.
I guess that having a DataType method to check on the two date types would be useful (a la isDateTimeOrNanos()).
There was a problem hiding this comment.
I really don't like adding more of those "helper" functions. In my opinion, it's not any more readable than just having another case in the switching logic, and in fact may be less readable. And I'd like to refactor this to use a map anyway, which we could reuse in the type checker.
Sure, I can add it. Is that something we're just doing on every PR that is being developed behind a feature flag now? |
|
@elasticmachine update branch |
…d-any-type-functions' into esql-nanos-and-any-type-functions
|
@elasticmachine update branch |
|
@elasticmachine update branch |
|
@elasticmachine update branch |
💚 Backport successful
|
…114056) Resolves elastic#109998 For the most part, this is just adding tests. Greater and Least have actual production code changes - notably toEvaluator is modified to map date nanos to the long evaluator. This parallels the work done in elastic#113961. I've added CSV tests and unit tests for all the functions listed in the original ticket. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…14056) (#115351) * [ESQL] Support date_nanos on functions that take "any" type (#114056) Resolves #109998 For the most part, this is just adding tests. Greater and Least have actual production code changes - notably toEvaluator is modified to map date nanos to the long evaluator. This parallels the work done in #113961. I've added CSV tests and unit tests for all the functions listed in the original ticket. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * Mute failing watcher test Cherry-pick f8e931d#diff-41386766c394f14f5f205f92bb26eb1420b80af0057c78b2842fcc7ddd3d67aaR326 For whatever reason, git cherry-pick is having some difficulty with this, so I just hand copied the mute. * pull in another mute --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…114056) Resolves elastic#109998 For the most part, this is just adding tests. Greater and Least have actual production code changes - notably toEvaluator is modified to map date nanos to the long evaluator. This parallels the work done in elastic#113961. I've added CSV tests and unit tests for all the functions listed in the original ticket. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…114056) Resolves elastic#109998 For the most part, this is just adding tests. Greater and Least have actual production code changes - notably toEvaluator is modified to map date nanos to the long evaluator. This parallels the work done in elastic#113961. I've added CSV tests and unit tests for all the functions listed in the original ticket. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Resolves #109998
For the most part, this is just adding tests.
GreaterandLeasthave actual production code changes - notablytoEvaluatoris modified to map date nanos to the long evaluator. This parallels the work done in #113961. I've added CSV tests and unit tests for all the functions listed in the original ticket.