Browse Source

use ROW in docs and added test with ROWS

Martijn van Groningen 2 years ago
parent
commit
c406b64058

+ 2 - 3
docs/reference/esql/functions/trim.asciidoc

@@ -4,7 +4,6 @@ Removes leading and trailing whitespaces from strings.
 
 [source,esql]
 ----
-FROM employees
-| KEEP first_name, last_name, height
-| EVAL trimmed_first_name = TRIM(first_name)
+ROW message = "   some text  "
+| EVAL message = TRIM(message)
 ----

+ 7 - 0
x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec

@@ -181,6 +181,13 @@ emp_no:integer | name:keyword
 10010 | Duangkaew
 ;
 
+trimRow
+ROW message = "   some text  ",  color = " red "| EVAL message = TRIM(message)| EVAL color = TRIM(color);
+
+message:s | color:s
+some text | red
+;
+
 concat
 from employees | sort emp_no | limit 10 | eval name = concat(first_name, " ", last_name) | keep emp_no, name;