{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "agg",
  "name" : "median",
  "description" : "The value that is greater than half of all values and less than half of all values, also known as the 50% `PERCENTILE`.",
  "note" : "Like `PERCENTILE`, `MEDIAN` is usually approximate.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "number",
          "type" : "double",
          "optional" : false,
          "description" : "Expression that outputs values to calculate the median of."
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "number",
          "type" : "integer",
          "optional" : false,
          "description" : "Expression that outputs values to calculate the median of."
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "number",
          "type" : "long",
          "optional" : false,
          "description" : "Expression that outputs values to calculate the median of."
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    }
  ],
  "examples" : [
    "FROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)",
    "FROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))"
  ],
  "preview" : false,
  "snapshot_only" : false
}
