Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Latest commit

 

History

History
61 lines (43 loc) · 1.16 KB

rename.rst

File metadata and controls

61 lines (43 loc) · 1.16 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:

od> 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:

od> 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    |
+------+---------+