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

[8.x] ESQL: Align year diffing to the rest of the units in DATE_DIFF: chronological (#113103) #113258

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

bpintea
Copy link
Contributor

@bpintea bpintea commented Sep 20, 2024

This will correct/switch "year" unit diffing from the current integer subtraction to a crono subtraction. Consequently, two dates are (at least) one year apart now if (at least) a full calendar year separates them. The previous implementation simply subtracted the year part of the dates.

Note: this parts with ES SQL's implementation of the same function, which itself is aligned with MS SQL's implementation, which works equivalent to an integer subtraction.

Fixes #112482.

(cherry picked from commit f7ff00f)

…ological (elastic#113103)

This will correct/switch "year" unit diffing from the current integer
subtraction to a crono subtraction. Consequently, two dates are (at
least) one year apart now if (at least) a full calendar year separates
them. The previous implementation simply subtracted the year part of the
dates.

Note: this parts with ES SQL's implementation of the same function,
which itself is aligned with MS SQL's implementation, which works
equivalent to an integer subtraction.

Fixes elastic#112482.

(cherry picked from commit f7ff00f)
@bpintea bpintea added backport auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Analytics/ES|QL AKA ESQL v8.16.0 labels Sep 20, 2024
@bpintea bpintea requested a review from a team as a code owner September 20, 2024 11:29
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine merged commit 6e314d6 into elastic:8.x Sep 20, 2024
16 checks passed
@bpintea bpintea deleted the port/113103 branch September 20, 2024 12:32
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 Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants