|
@@ -17,6 +17,7 @@ these functions:
|
|
|
* <<esql-length>>
|
|
|
* <<esql-pow>>
|
|
|
* <<esql-round>>
|
|
|
+* <<esql-split>>
|
|
|
* <<esql-starts_with>>
|
|
|
* <<esql-substring>>
|
|
|
|
|
@@ -53,7 +54,7 @@ FROM employees
|
|
|
=== `CIDR_MATCH`
|
|
|
|
|
|
Returns `true` if the provided IP is contained in one of the provided CIDR
|
|
|
-blocks.
|
|
|
+blocks.
|
|
|
|
|
|
`CIDR_MATCH` accepts two or more arguments. The first argument is the IP
|
|
|
address of type `ip` (both IPv4 and IPv6 are supported). Subsequent arguments
|
|
@@ -83,7 +84,7 @@ is specified, the `yyyy-MM-dd'T'HH:mm:ss.SSSZ` format is used.
|
|
|
|
|
|
[source,esql]
|
|
|
----
|
|
|
-FROM employees
|
|
|
+FROM employees
|
|
|
| PROJECT first_name, last_name, hire_date
|
|
|
| EVAL hired = DATE_FORMAT(hire_date, "YYYY-MM-dd")
|
|
|
----
|
|
@@ -107,7 +108,7 @@ Returns a boolean that indicates whether its input is a finite number.
|
|
|
|
|
|
[source,esql]
|
|
|
----
|
|
|
-ROW d = 1.0
|
|
|
+ROW d = 1.0
|
|
|
| EVAL s = IS_FINITE(d/0)
|
|
|
----
|
|
|
|
|
@@ -117,7 +118,7 @@ Returns a boolean that indicates whether its input is infinite.
|
|
|
|
|
|
[source,esql]
|
|
|
----
|
|
|
-ROW d = 1.0
|
|
|
+ROW d = 1.0
|
|
|
| EVAL s = IS_INFINITE(d/0)
|
|
|
----
|
|
|
|
|
@@ -127,7 +128,7 @@ Returns a boolean that indicates whether its input is not a number.
|
|
|
|
|
|
[source,esql]
|
|
|
----
|
|
|
-ROW d = 1.0
|
|
|
+ROW d = 1.0
|
|
|
| EVAL s = IS_NAN(d)
|
|
|
----
|
|
|
|
|
@@ -162,12 +163,12 @@ FROM employees
|
|
|
|
|
|
[[esql-pow]]
|
|
|
=== `POW`
|
|
|
-Returns the the value of a base (first argument) raised to a power (second
|
|
|
+Returns the the value of a base (first argument) raised to a power (second
|
|
|
argument).
|
|
|
|
|
|
[source,esql]
|
|
|
----
|
|
|
-ROW base = 2.0, exponent = 2.0
|
|
|
+ROW base = 2.0, exponent = 2.0
|
|
|
| EVAL s = POW(base, exponent)
|
|
|
----
|
|
|
|
|
@@ -184,9 +185,12 @@ FROM employees
|
|
|
| EVAL height = ROUND(height * 3.281, 1)
|
|
|
----
|
|
|
|
|
|
+include::functions/split.asciidoc[]
|
|
|
+
|
|
|
+
|
|
|
[[esql-starts_with]]
|
|
|
=== `STARTS_WITH`
|
|
|
-Returns a boolean that indicates whether a keyword string starts with another
|
|
|
+Returns a boolean that indicates whether a keyword string starts with another
|
|
|
string:
|
|
|
|
|
|
[source,esql]
|
|
@@ -205,7 +209,7 @@ length. This example returns the first three characters of every last name:
|
|
|
----
|
|
|
FROM employees
|
|
|
| PROJECT last_name
|
|
|
-| EVAL ln_sub = SUBSTRING(last_name, 1, 3)
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, 1, 3)
|
|
|
----
|
|
|
|
|
|
A negative start position is interpreted as being relative to the end of the
|
|
@@ -215,7 +219,7 @@ string. This example returns the last three characters of of every last name:
|
|
|
----
|
|
|
FROM employees
|
|
|
| PROJECT last_name
|
|
|
-| EVAL ln_sub = SUBSTRING(last_name, -3, 3)
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, -3, 3)
|
|
|
----
|
|
|
|
|
|
If length is omitted, substring returns the remainder of the string. This
|
|
@@ -225,5 +229,5 @@ example returns all characters except for the first:
|
|
|
----
|
|
|
FROM employees
|
|
|
| PROJECT last_name
|
|
|
-| EVAL ln_sub = SUBSTRING(last_name, 2)
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, 2)
|
|
|
----
|