Skip to content

Commit c6a0a1a

Browse files
committed
ESQL: Updated RENAME docs with the behaviour of multiple column renames
1 parent a6ffeee commit c6a0a1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/reference/query-languages/esql/esql-commands.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ RENAME old_name1 AS new_name1[, ..., old_nameN AS new_nameN]
802802

803803
The `RENAME` processing command renames one or more columns. If a column with the new name already exists, it will be replaced by the new column.
804804

805+
A `RENAME` with multiple column renames is equivalent to multiple sequential `RENAME` commands.
806+
805807
**Examples**
806808

807809
```esql
@@ -818,6 +820,15 @@ FROM employees
818820
| RENAME first_name AS fn, last_name AS ln
819821
```
820822

823+
With multiple `RENAME` commands:
824+
825+
```esql
826+
FROM employees
827+
| KEEP first_name, last_name
828+
| RENAME first_name AS fn
829+
| RENAME last_name AS ln
830+
```
831+
821832

822833
## `SORT` [esql-sort]
823834

0 commit comments

Comments
 (0)