Skip to content
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
This repository was archived by the owner on Nov 7, 2018. It is now read-only.

Stats queries return integers as numbers, floats as strings #278

@yozlet

Description

@yozlet

Example:

{
  "aggregations": {
    "school.tuition_revenue_per_fte": {
      "count": 7362,
      "min": 0,
      "max": 207213,
      "avg": "0.9954935343656614E4",
      "sum": 73288234,
      "sum_of_squares": 1249896256472,
      "variance": "0.7067598825743325E8",
      "std_deviation": "0.8406901228005076E4",
      "std_deviation_bounds": {
        "upper": "0.26768737799666764E5",
        "lower": "-0.6858867112353537E4"
      }
    }
  }
}

... whereas what we get when querying ES directly is:

{
  "aggregations": {
    "school.tuition_revenue_per_fte": {
      "count": 7362,
      "min": 0,
      "max": 207213,
      "avg": 9954.935343656614,
      "sum": 7.3288234E7,
      "sum_of_squares": 1.249896256472E12,
      "variance": 7.067598825743325E7,
      "std_deviation": 8406.901228005076,
      "std_deviation_bounds": {
        "upper": 26768.737799666764,
        "lower": -6858.867112353537
      }
    }
  }
}

I initially thought this was something to do with Ruby mis-parsing scientific notation, but now I suspect it's something in our type-detection output code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions