[Feature] showperc with top and rare commands.#5642
Conversation
PR Reviewer Guide 🔍(Review updated until commit b576e5a)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to b576e5a Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 0039627
Suggestions up to commit 0b5b6ed
Suggestions up to commit dae1ecd
Suggestions up to commit ca7e450
Suggestions up to commit 54ab043
|
54ab043 to
ca7e450
Compare
|
Persistent review updated to latest commit ca7e450 |
ca7e450 to
dae1ecd
Compare
|
Persistent review updated to latest commit dae1ecd |
dae1ecd to
0b5b6ed
Compare
|
Persistent review updated to latest commit 0b5b6ed |
0b5b6ed to
0039627
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 0039627.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 0039627 |
* Clean docs * Fix CalcitePPLRareTopNTest showperc tests * Calculate percentages before filtering Signed-off-by: Ajimelec Gonzalez <ajimelec@amazon.com>
0039627 to
b576e5a
Compare
|
Persistent review updated to latest commit b576e5a |
Description
Add
showpercoption to thetopandrarePPL commands. Whenshowperc=trueis specified, a percent column is added to the output showing each value's percentage of the total count within its partition (group-by clause).The percentage is computed as
ROUND(100.0 * count / SUM(count) OVER (PARTITION BY group_fields), 2)and is rounded to 2 decimal places. When used with a by clause, percentages are calculated within each partition (summing to 100% per group).Syntax
source=index | top showperc=true field_name [by group_field]source=index | rare showperc=true field_name [by group_field]TopExamplesource=otellogs | top showperc=true severityTextReturns:
RareExamplesource=otellogs | rare showperc=true severityTextReturns:
Related Issues
Resolves #5530
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.