-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Avoid overflow when sorting missing last on epoch_millis datetime field #12676
Avoid overflow when sorting missing last on epoch_millis datetime field #12676
Conversation
Fixes opensearch-project#10253 Signed-off-by: Michael Froh <froh@amazon.com>
2171127
to
8187f65
Compare
Compatibility status:Checks if related components are compatible with change 8187f65 Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/sql.git] |
❕ Gradle check result for 2171127: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12676 +/- ##
============================================
+ Coverage 71.42% 71.43% +0.01%
- Complexity 59978 60068 +90
============================================
Files 4985 4989 +4
Lines 282275 282578 +303
Branches 40946 40985 +39
============================================
+ Hits 201603 201866 +263
- Misses 63999 64021 +22
- Partials 16673 16691 +18 ☔ View full report in Codecov by Sentry. |
…ld (opensearch-project#12676) Fixes opensearch-project#10253 Signed-off-by: Michael Froh <froh@amazon.com>
…ld (opensearch-project#12676) Fixes opensearch-project#10253 Signed-off-by: Michael Froh <froh@amazon.com>
…ld (opensearch-project#12676) Fixes opensearch-project#10253 Signed-off-by: Michael Froh <froh@amazon.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Fixes #10253
Description
When sorting a datetime field with
epoch_millis
formatting and putting missing values last (with a descending sort) or first (with ascending sort), the datetime value isLong.MIN_VALUE
.When we try to render that, the formatter tries to emit the negative sign, followed by the absolute value of the original value. Since
Long.MIN_VALUE = -Long.MAX_VALUE - 1
, it is not possible to represent-Long.MIN_VALUE
as along
.To work around this, my proposed fix introduces an off-by-one error by truncating to
Long.MAX_VALUE
.Related Issues
Resolves #10253
Check List
New functionality has been documented.New functionality has javadoc addedPublic documentation issue/PR createdBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.