{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "scalar",
  "name" : "to_long",
  "description" : "Converts the input value to a long.\nIf the input parameter is of a date type, its value will be interpreted as milliseconds\nsince the Unix epoch, converted to long.\nBoolean `true` will be converted to long `1`, `false` to `0`.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "field",
          "type" : "boolean",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_integer",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_long",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "date_nanos",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "geohash",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "geohex",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "geotile",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "keyword",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "keyword",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "integer",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "keyword",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "long",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "keyword",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "unsigned_long",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "text",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "text",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "integer",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "text",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "long",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "text",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        },
        {
          "name" : "base",
          "type" : "unsigned_long",
          "optional" : true,
          "description" : "(Optional) Radix or base used to convert the input value.When a base is specified the input type must be `keyword` or `text`."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "unsigned_long",
          "optional" : false,
          "description" : "Input value. The input can be a single- or multi-valued column or an expression."
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    }
  ],
  "examples" : [
    "ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n| EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)",
    "ROW str1 = \"0x32\", str2 = \"31\"\n| EVAL long1 = TO_LONG(str1, 16), long2 = TO_LONG(str2, 13)\n| KEEP str1, long1, str2, long2",
    "ROW str1 = \"Hazelnut\"\n| EVAL long1 = TO_LONG(str1, 36), fail1 = TO_LONG(str1, 10)"
  ],
  "preview" : false,
  "snapshot_only" : false
}
