Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 1.59 KB

top.rst

File metadata and controls

74 lines (52 loc) · 1.59 KB

top

Table of contents

Using top command to find the most common tuple of values of all fields in the field list.

top [N] <field-list> [by-clause]

  • N: number of results to return. Default: 10
  • field-list: mandatory. comma-delimited list of field names.
  • by-clause: optional. one or more fields to group the results by.

The example finds most common gender of all the accounts.

PPL query:

od> source=accounts | top gender;
fetched rows / total rows = 2/2
+------------+
| gender     |
|------------|
| M          |
|------------|
| F          |
+------------+

The example finds most common gender of all the accounts.

PPL query:

od> source=accounts | top 1 gender;
fetched rows / total rows = 1/1
+------------+
| gender     |
|------------|
| M          |
+------------+

The example finds most common age of all the accounts group by gender.

PPL query:

od> source=accounts | top 1 age by gender;
fetched rows / total rows = 2/2
+----------+----------+
| gender   | age      |
|----------+----------|
| F        | 39       |
| M        | 31       |
+----------+----------+