Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESQL] Basic casting for Date Nanos #111850

Merged

Conversation

not-napoleon
Copy link
Member

Resolves #109990

For the most part, this should be straightforward. The only "decision" being made here is to truncate when casting to millisecond dates, which is what we do in the DateUtils library class, and seems like a sensible choice. Nothing in here needs to be controlled via the feature flag, as we already just set the type to UNSUPPORTED when the flag is disabled.

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 13, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@@ -230,7 +232,7 @@ public static Iterable<Object[]> parameters() {
return parameterSuppliersFromTypedDataWithDefaultChecks(
true,
suppliers,
(v, p) -> "boolean or counter_integer or counter_long or datetime or numeric or string"
(v, p) -> "boolean or counter_integer or counter_long or date_nanos or datetime or numeric or string"
Copy link
Member

Choose a reason for hiding this comment

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

Should I look into making sure these don't leak date_nanos when the feature flag is disabled?

@not-napoleon not-napoleon added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Aug 14, 2024
@elasticsearchmachine elasticsearchmachine merged commit 2ded98b into elastic:main Aug 14, 2024
15 checks passed
@not-napoleon not-napoleon deleted the esql-date-nanos-casting branch August 14, 2024 16:12
not-napoleon added a commit that referenced this pull request Aug 15, 2024
resolves #109992

Nothing fancy here. Nanosecond dates are still longs, and we can just compare them as longs. Please note that, as mentioned in the linked issue, this only supports comparing date nanos to other date nanos, and not comparing to millisecond dates. With the cast functions added in #111850, users can explicitly cast to millisecond dates (or longs) to compare nanos to other things.
elasticsearchmachine pushed a commit that referenced this pull request Aug 19, 2024
These are generated files, resulting from [this
PR](#111850).
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Sep 4, 2024
Resolves elastic#109990

For the most part, this should be straightforward.  The only "decision"
being made here is to truncate when casting to millisecond dates, which
is what we do in the `DateUtils` library class, and seems like a
sensible choice.  Nothing in here needs to be controlled via the feature
flag, as we already just set the type to `UNSUPPORTED` when the flag is
disabled.
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Sep 4, 2024
resolves elastic#109992

Nothing fancy here. Nanosecond dates are still longs, and we can just compare them as longs. Please note that, as mentioned in the linked issue, this only supports comparing date nanos to other date nanos, and not comparing to millisecond dates. With the cast functions added in elastic#111850, users can explicitly cast to millisecond dates (or longs) to compare nanos to other things.
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Sep 4, 2024
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Sep 5, 2024
Resolves elastic#109990

For the most part, this should be straightforward.  The only "decision"
being made here is to truncate when casting to millisecond dates, which
is what we do in the `DateUtils` library class, and seems like a
sensible choice.  Nothing in here needs to be controlled via the feature
flag, as we already just set the type to `UNSUPPORTED` when the flag is
disabled.
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Sep 5, 2024
resolves elastic#109992

Nothing fancy here. Nanosecond dates are still longs, and we can just compare them as longs. Please note that, as mentioned in the linked issue, this only supports comparing date nanos to other date nanos, and not comparing to millisecond dates. With the cast functions added in elastic#111850, users can explicitly cast to millisecond dates (or longs) to compare nanos to other things.
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Sep 5, 2024
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-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ESQL] Support basic casting for date nanos
3 participants