You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/ppl/cmd/fields.rst
+165-4Lines changed: 165 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,7 @@ Description
13
13
============
14
14
Using ``field`` command to keep or remove fields from the search result.
15
15
16
-
.. note::
17
-
Enhanced field features are available when the Calcite engine is enabled. For detailed documentation on enhanced features, see `fields-enhanced <fields-enhanced.rst>`_
16
+
Enhanced field features are available when the Calcite engine is enabled with 3.3+ version. When Calcite is disabled, only basic comma-delimited field selection is supported.
18
17
19
18
Syntax
20
19
============
@@ -24,8 +23,11 @@ field [+|-] <field-list>
24
23
* field list: mandatory. comma-delimited keep or remove fields.
25
24
26
25
26
+
Basic Examples
27
+
==============
28
+
27
29
Example 1: Select specified fields from result
28
-
==============================================
30
+
----------------------------------------------
29
31
30
32
The example show fetch account_number, firstname and lastname fields from search results.
31
33
@@ -43,7 +45,7 @@ PPL query::
43
45
+----------------+-----------+----------+
44
46
45
47
Example 2: Remove specified fields from result
46
-
==============================================
48
+
----------------------------------------------
47
49
48
50
The example show fetch remove account_number field from search results.
49
51
@@ -59,3 +61,162 @@ PPL query::
59
61
| Nanette | Bates |
60
62
| Dale | Adams |
61
63
+-----------+----------+
64
+
65
+
Enhanced Features (Version 3.3.0)
66
+
===========================================
67
+
68
+
All features in this section require the Calcite engine to be enabled. When Calcite is disabled, only basic comma-delimited field selection is supported.
69
+
70
+
Example 3: Space-delimited field selection
71
+
-------------------------------------------
72
+
73
+
Fields can be specified using spaces instead of commas, providing a more concise syntax.
Automatically prevents duplicate columns when wildcards expand to already specified fields.
163
+
164
+
PPL query::
165
+
166
+
os> source=accounts | fields firstname, *name;
167
+
fetched rows / total rows = 4/4
168
+
+-----------+----------+
169
+
| firstname | lastname |
170
+
|-----------+----------|
171
+
| Amber | Duke |
172
+
| Hattie | Bond |
173
+
| Nanette | Bates |
174
+
| Dale | Adams |
175
+
+-----------+----------+
176
+
177
+
Note: Even though ``firstname`` is explicitly specified and would also match ``*name``, it appears only once due to automatic deduplication.
178
+
179
+
Example 9: Full wildcard selection
180
+
-----------------------------------
181
+
182
+
Select all available fields using ``*`` or ```*```. This selects all fields defined in the index schema, including fields that may contain null values.
Note: The ``*`` wildcard selects fields based on the index schema, not on data content. Fields with null values are included in the result set. Use backticks ```*``` if the plain ``*`` doesn't return all expected fields.
195
+
196
+
Example 10: Wildcard exclusion
197
+
-------------------------------
198
+
199
+
Remove fields using wildcard patterns with the minus (-) operator.
0 commit comments