{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "round_to",
  "description" : "Rounds down to one of a list of fixed points.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "date",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "date"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date_nanos",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "date_nanos",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "date_nanos"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "double",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "integer",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "long",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "double",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "integer",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "integer"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "long",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "double",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "integer",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "The numeric value to round. If `null`, the function returns `null`."
        },
        {
          "name" : "points",
          "type" : "long",
          "optional" : false,
          "description" : "Remaining rounding points. Must be constants."
        }
      ],
      "variadic" : true,
      "returnType" : "long"
    }
  ],
  "examples" : [
    "FROM employees\n| STATS COUNT(*) BY birth_window=ROUND_TO(\n    birth_date,\n    \"1900-01-01T00:00:00Z\"::DATETIME,\n    \"1950-01-01T00:00:00Z\"::DATETIME,\n    \"1955-01-01T00:00:00Z\"::DATETIME,\n    \"1960-01-01T00:00:00Z\"::DATETIME,\n    \"1965-01-01T00:00:00Z\"::DATETIME,\n    \"1970-01-01T00:00:00Z\"::DATETIME,\n    \"1975-01-01T00:00:00Z\"::DATETIME\n)\n| SORT birth_window ASC"
  ],
  "preview" : false,
  "snapshot_only" : false
}
