Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.29 KB

rename.rst

File metadata and controls

64 lines (46 loc) · 1.29 KB

rename

Table of contents

Using rename command to rename one or more fields in the search result.

rename <source-field> AS <target-field>["," <source-field> AS <target-field>]...

  • source-field: mandatory. The name of the field you want to rename.
  • field list: mandatory. The name you want to rename to.

The example show rename one field.

PPL query:

os> source=accounts | rename account_number as an | fields an;
fetched rows / total rows = 4/4
+------+
| an   |
|------|
| 1    |
| 6    |
| 13   |
| 18   |
+------+

The example show rename multiple fields.

PPL query:

os> source=accounts | rename account_number as an, employer as emp | fields an, emp;
fetched rows / total rows = 4/4
+------+---------+
| an   | emp     |
|------+---------|
| 1    | Pyrami  |
| 6    | Netagy  |
| 13   | Quility |
| 18   | null    |
+------+---------+

The rename command is not rewritten to OpenSearch DSL, it is only executed on the coordination node.