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

[BUG] Large values do not display correctly in OpenSearch Dashboards #5485

Closed
dlvenable opened this issue Nov 16, 2023 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dlvenable
Copy link
Member

dlvenable commented Nov 16, 2023

Describe the bug

Large long values display incorrect values in OpenSearch Dashboards. These large values appear to lose precision or in some cases show slightly different values in the less significant digits.

To Reproduce
Steps to reproduce the behavior:

  1. Download this Docker compose file.
  2. docker compose up
  3. Run the following _bulk request:
curl -k -u "admin:admin" https://localhost:9200/_bulk -X PUT --header 'Content-Type:application/json' -d '{"index":{"_id":"TEST1","_index":"test-input"}}
{"VeryLargeValue":1234567891011121314,"Version":1,"Name":"TEST1"}
{"index":{"_id":"TEST2","_index":"test-input"}}
{"Version":2,"VeryLargeNumber":1234567891011121314,"Name":"TEST2"}
'
  1. Use curl to verify it is correct:
curl -k -u "admin:admin" 'https://localhost:9200/test-input/_search?pretty'
  1. Load http://localhost:5601/app/dev_tools#/console
  2. Paste and execute:
GET test-input/_search
{
  "query": {
    "match_all": {}
  }
}

  1. See that the values are not quite correct:
{
  "took": 4,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 2,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "test-input",
        "_id": "TEST1",
        "_score": 1,
        "_source": {
          "VeryLargeValue": 1234567891011121400,
          "Version": 1,
          "Name": "TEST1"
        }
      },
      {
        "_index": "test-input",
        "_id": "TEST2",
        "_score": 1,
        "_source": {
          "Version": 2,
          "VeryLargeNumber": 1234567891011121400,
          "Name": "TEST2"
        }
      }
    ]
  }
}
  1. Create an index pattern and view in Discover tab.
OSD-invalid

Expected behavior

Using OpenSearch Dashboards, I should see all these values correctly.

OpenSearch Version

OpenSearch 2.9
OpenSearch 2.11

Dashboards Version

Dashboards 2.9
Dashboards 2.11

Plugins

Standard

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: macOS
  • Firefox
@dlvenable dlvenable added bug Something isn't working untriaged labels Nov 16, 2023
@dlvenable
Copy link
Member Author

Results from curl showing the data is correct in OpenSearch:

curl -k -u "admin:admin" 'https://localhost:9200/test-input/_search?pretty'
{
  "took" : 29,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 2,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test-input",
        "_id" : "TEST1",
        "_score" : 1.0,
        "_source" : {
          "VeryLargeValue" : 1234567891011121314,
          "Version" : 1,
          "Name" : "TEST1"
        }
      },
      {
        "_index" : "test-input",
        "_id" : "TEST2",
        "_score" : 1.0,
        "_source" : {
          "Version" : 2,
          "VeryLargeNumber" : 1234567891011121314,
          "Name" : "TEST2"
        }
      }
    ]
  }
}

@AMoo-Miki
Copy link
Collaborator

David, #5095 addressed this in 2.11. I will check to see if anything changed between in being merged and the release.

@AMoo-Miki AMoo-Miki self-assigned this Nov 16, 2023
@AMoo-Miki
Copy link
Collaborator

AMoo-Miki commented Dec 12, 2023

Here is what I found:

  • Long numerals were only supported in the Dev Tools prior to being broken in 2.9 and fixed in 2.11.
  • Long numerals never worked in Discover, Search, Filters, or any of the visualizations. I have [Discover] Add long numerals support #5592 to add this feature to Discover, Search, and Filters; visualizations will have to wait for someone else to add this.

I am looking to see why you are getting results that don't match expectations.

@AMoo-Miki
Copy link
Collaborator

On a 2.11.1, I have confirmed that long numerals work in the Dev Tools, as expected. Will try to reach out offline and figure out the circumstances.

@dlvenable
Copy link
Member Author

@AMoo-Miki , Thank you for working on this issue.

I have tested this on both OpenSearch 2.11.0 and 2.11.1. I do not see this bug on either of those versions. So I'll go ahead and close the issue.

@seaneez
Copy link

seaneez commented Aug 1, 2024

Hello, @AMoo-Miki

Thank you for fixing the long type number display issue.

We are currently using values that correspond to the unsigned long type, but precision errors still occur with such large numbers.

Could you please fix the bug so that unsigned long type numbers are also displayed accurately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants