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

support date_nanos type when select time field for creating monitor #954

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

Hailong-am
Copy link
Contributor

@Hailong-am Hailong-am commented May 23, 2024

Description

Add date_nanos support for time field selection

test date_nanos field with range query which used in define the query condition in creating monitor, it works as expected without exception.

PUT my-index-000001
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date_nanos" 
      }
    }
  }
}

PUT my-index-000001/_bulk?refresh
{ "index" : { "_id" : "1" } }
{ "date": "2015-01-01" } 
{ "index" : { "_id" : "2" } }
{ "date": "2015-01-01T12:10:30.123456789Z" } 
{ "index" : { "_id" : "3" } }
{ "date": 1420070400000 } 


GET my-index-000001/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "range": {
            "date": {
              "gte": "1420114200000||-1d",
              "lte": "1420114200000||+1d",
              "format": "epoch_millis"
            }
          }
        }
      ]
    }
  }
}

Issues Resolved

#927

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By 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.

@riysaxen-amzn
Copy link
Collaborator

can we check why e2e are failing?

@Hailong-am
Copy link
Contributor Author

can we check why e2e are failing?

OpenSearch cluster failed to start will fixed by opensearch-project/alerting#1558, after that we can retry the CI

@Hailong-am
Copy link
Contributor Author

can we check why e2e are failing?

OpenSearch cluster failed to start will fixed by opensearch-project/alerting#1558, after that we can retry the CI

@riysaxen-amzn @AWSHurneyt can you help to re-run the failed CI?

@AWSHurneyt
Copy link
Collaborator

@Hailong-am I can't seem to rerun the CI. Could you submit an empty commit to get them to run?

Signed-off-by: Hailong Cui <[email protected]>
@Hailong-am
Copy link
Contributor Author

@Hailong-am I can't seem to rerun the CI. Could you submit an empty commit to get them to run?

@AWSHurneyt rebase from main and all CIs are passed @riysaxen-amzn would you mind to help to review?

@AWSHurneyt
Copy link
Collaborator

@Hailong-am Does this need any backporting?

@Hailong-am
Copy link
Contributor Author

@Hailong-am Does this need any backporting?

please help to add backport 2.x label, thanks

@riysaxen-amzn riysaxen-amzn merged commit ce4742b into opensearch-project:main Aug 1, 2024
9 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 1, 2024
Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit ce4742b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
riysaxen-amzn pushed a commit that referenced this pull request Aug 1, 2024
(cherry picked from commit ce4742b)

Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants