-
Notifications
You must be signed in to change notification settings - Fork 177
Update PPL Command Documentation #4562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
8445ebb
81e2da1
3ea70a5
0dc4a62
3c67613
7dd7db9
66a3e97
06f0f8d
657f38e
055030a
a422a2d
e4f01a0
09da08c
1165d0f
7470967
8886563
54464e3
50d95b3
f43765d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,47 +11,15 @@ appendcol | |
|
|
||
| Description | ||
| ============ | ||
| | (Experimental) | ||
| | (From 3.1.0) | ||
| | Using ``appendcol`` command to append the result of a sub-search and attach it alongside with the input search results (The main search). | ||
|
|
||
| Version | ||
| ======= | ||
| 3.1.0 | ||
| | The ``appendcol`` command appends the result of a sub-search and attaches it alongside with the input search results (The main search). | ||
|
||
|
|
||
| Syntax | ||
| ============ | ||
| appendcol [override=<boolean>] <sub-search> | ||
|
|
||
| * override=<boolean>: optional. Boolean field to specify should result from main-result be overwritten in the case of column name conflict. | ||
| * override=<boolean>: optional. Boolean field to specify should result from main-result be overwritten in the case of column name conflict. **Default:** false. | ||
| * sub-search: mandatory. Executes PPL commands as a secondary search. The sub-search uses the same data specified in the source clause of the main search results as its input. | ||
|
|
||
| Configuration | ||
| ============= | ||
| This command requires Calcite enabled. | ||
|
|
||
| Enable Calcite:: | ||
|
|
||
| >> curl -H 'Content-Type: application/json' -X PUT localhost:9200/_plugins/_query/settings -d '{ | ||
| "transient" : { | ||
| "plugins.calcite.enabled" : true | ||
| } | ||
| }' | ||
|
|
||
| Result set:: | ||
|
|
||
| { | ||
| "acknowledged": true, | ||
| "persistent": { | ||
| "plugins": { | ||
| "calcite": { | ||
| "enabled": "true" | ||
| } | ||
| } | ||
| }, | ||
| "transient": {} | ||
| } | ||
|
|
||
| Example 1: Append a count aggregation to existing search result | ||
| =============================================================== | ||
|
|
||
|
|
@@ -103,6 +71,8 @@ PPL query:: | |
| Example 3: Append multiple sub-search results | ||
| ============================================= | ||
|
|
||
| This example shows how to chain multiple appendcol commands to add columns from different sub-searches. | ||
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source=employees | fields name, dept, age | appendcol [ stats avg(age) as avg_age ] | appendcol [ stats max(age) as max_age ]; | ||
|
|
@@ -124,6 +94,8 @@ PPL query:: | |
| Example 4: Override case of column name conflict | ||
| ================================================ | ||
|
|
||
| This example demonstrates the override option when column names conflict between main search and sub-search. | ||
|
|
||
| PPL query:: | ||
|
|
||
| PPL> source=employees | stats avg(age) as agg by dept | appendcol override=true [ stats max(age) as agg by dept ]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a
|before head of this line.