{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "mv_slice",
  "description" : "Returns a subset of the multivalued field using the start and end index values.\nThis is most useful when reading from a function that emits multivalued columns\nin a known order like `SPLIT` or `MV_SORT`.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "field",
          "type" : "boolean",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "boolean"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "cartesian_point",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "cartesian_point"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "cartesian_shape",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "cartesian_shape"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "date"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date_nanos",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "date_nanos"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "geo_point",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "geo_point"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "geo_shape",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "geo_shape"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "integer"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "ip",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "ip"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "keyword",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "keyword"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "text",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "keyword"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "unsigned_long",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "unsigned_long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "version",
          "optional" : false,
          "description" : "Multivalue expression. If `null`, the function returns `null`."
        },
        {
          "name" : "start",
          "type" : "integer",
          "optional" : false,
          "description" : "Start position. If `null`, the function returns `null`. The start argument can be negative. An index of -1 is used to specify the last value in the list."
        },
        {
          "name" : "end",
          "type" : "integer",
          "optional" : true,
          "description" : "End position(included). Optional; if omitted, the position at `start` is returned. The end argument can be negative. An index of -1 is used to specify the last value in the list."
        }
      ],
      "variadic" : false,
      "returnType" : "version"
    }
  ],
  "examples" : [
    "row a = [1, 2, 2, 3]\n| eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)",
    "row a = [1, 2, 2, 3]\n| eval a1 = mv_slice(a, -2), a2 = mv_slice(a, -3, -1)"
  ],
  "preview" : false,
  "snapshot_only" : false
}
