generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 178
Feature addtotals and addcoltotals #4754
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
Open
asifabashar
wants to merge
22
commits into
opensearch-project:main
Choose a base branch
from
asifabashar:feature-addtotals-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature addtotals and addcoltotals #4754
asifabashar
wants to merge
22
commits into
opensearch-project:main
from
asifabashar:feature-addtotals-2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Contributor
Author
|
@penghuo Please review |
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
Signed-off-by: Asif Bashar <[email protected]>
asifabashar
commented
Nov 10, 2025
ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java
Show resolved
Hide resolved
asifabashar
commented
Nov 10, 2025
ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java
Show resolved
Hide resolved
asifabashar
commented
Nov 10, 2025
ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java
Show resolved
Hide resolved
Contributor
Author
|
@penghuo please review |
Contributor
Author
|
@LantaoJin Please review |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Is your feature request related to a problem?
addtotals command to show total of all columns of each row as a new column , and also have option to show total of all rows of each column values to show at the end of rows.
Fixes issue #4607
From roadmap #4287
addcoltotals command to show total of each column's all rows values to show at the end of rows.
From roadmap #4287
What solution would you like?
command: addtotals ,addcoltotals
addtotals: Add totals across rows by default and also calculate total across columns when col=true
The addtotals command computes the arithmetic sum of all numeric fields for each search result.
You can specify a list of fields that you want the sum for, instead of calculating every numeric field.
The sum is placed in a new field.
If col=true, the addtotals command computes the column totals, which adds a new result at the end that represents the sum of each field.
labelfield, if specified, is a field that will be added to this summary event with the value set by the label option.
Alternatively, instead of using the addtotals col=true command, you can use the addcoltotals command to calculate a summary event.
labelfield, if specified, is a field that will be added at the last row of the column specified by labalfield with the value set by the 'label' option.
Syntax
addtotals [row=] [col=] [labelfield=] [label=] [fieldname=] []
Required arguments
None.
Optional arguments
row
Syntax:
row=
Description:
Specifies whether to calculate the sum of the for each event.
This is similar to calculating a total for each row in a table.
The sum is placed in a new field. The default name of the field is Total.
If you want to specify a different name for the field, use the fieldname argument.
Usage:
Because the default is row=true, specify the row argument only when you do not want the event totals to appear (row=false).
Default:
true
col
Syntax:
col=
Description:
Specifies whether to add a new event, referred to as a summary event, at the bottom of the list of events.
The summary event displays the sum of each field in the events, similar to calculating column totals in a table.
Default:
false
fieldname
Syntax:
fieldname=
Description:
Used to specify the name of the field that contains the calculated sum of the field-list for each event.
The fieldname argument is valid only when row=true.
Default:
Total
field-list
Syntax: ...
Description: One or more numeric fields, delimited with a space. Only the fields specified in the are summed. If a is not specified, all numeric fields are included in the sum.
Usage: You can use wildcards in the field names. For example, if the field names are count1, count2, and count3 you can specify count* to indicate all fields that begin with 'count'.
Default: All numeric fields are included in the sum.
labelfield
Syntax: labelfield=
Description:
Used to specify a field for the summary event label.
The labelfield argument is valid only when col=true.
To use an existing field in your result set, specify the field name for the labelfield argument.
For example, if the field name is IP, specify labelfield=IP.
If there is no field in your result set that matches the labelfield, a new field is added using the labelfield value.
Default:
none
label
Syntax:
label=
Description:
Used to specify a row label for the summary event.
If the labelfield argument is an existing field in your result set, the label value appears in that row in the display.
If the labelfield argument creates a new field, the label appears in the new field in the summary event row.
Default:
Total
command addcoltotals: Add totals across columns of each row to show total in a new field.
addcoltotals: options
Optional Arguments
Syntax: ...
Description: A space-delimited list of valid field names. addcoltotals calculates the sum only for the fields in the list you specify.
You can use the asterisk () as a wildcard to specify fields with similar names.
Example: To specify all fields that start with "value", use value.
Default: Calculates the sum for all fields.
labelfield
Syntax: labelfield=
Description: Specify a field name to add to the result set.
Default: none
label
Syntax: label=
Description: Used with the labelfield argument to add a label in the summary event. If the labelfield argument is absent, the label argument has no effect.
Default: Total
Related Issues
Resolves #4607 [#4607 ]
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.