Skip to content

[Backport 2.19-dev] Support chart command in PPL (#4579)#4756

Merged
LantaoJin merged 4 commits intoopensearch-project:2.19-devfrom
yuancu:backport/backport-4579-to-2.19-dev
Nov 10, 2025
Merged

[Backport 2.19-dev] Support chart command in PPL (#4579)#4756
LantaoJin merged 4 commits intoopensearch-project:2.19-devfrom
yuancu:backport/backport-4579-to-2.19-dev

Conversation

@yuancu
Copy link
Copy Markdown
Collaborator

@yuancu yuancu commented Nov 7, 2025

Description

Backport #4579 to 2.19-dev

Commit Message

  • WIP: Make poc implementation for chart command

  • Support param useother and otherstr

  • Support usenull and nullstr (when both row split and col split present)

  • Append a final aggregation to merge OTHER categories

  • Handle common agg functions for OTHER category for timechart

  • Fix timechart IT

  • Sort earliest results with asc order

  • Support non-string fields as column split

  • Fix min/earliest order & fix non-accumulative agg for chart

  • Hint non-null in aggregateWithTrimming

  • Add integration tests for chart command

  • Add unit tests

  • Add doc for chart command

  • Prompt users that multiple agg is not supported

  • Add explain ITs

  • Remove unimplemented support for multiple aggregations in chart command

  • Add unit tests for chart command

  • Remove irrelevant yaml test

  • Tweak chart.rst

  • Swap the order of chart output to ensure metrics come last

  • Filter rows without col split when calculate grand total

  • Chores: tweak code order

  • Add anonymize test to chart command

  • Change grammart from limit=top 10 to limit=top10

  • Update chart doc

  • Rename row_number for chart to row_number_chart

  • Sort by row and col splits on top of chart results

  • Ignore rows without a row split in chart command

  • Keep categories with max summed values when top k is set

  • Simplify toAddHintsOnAggregate condition

  • Chores: eliminate unnecessary variables

  • Apply a non-null filter on fields referred by aggregations

  • Fix chart plans

  • Get rid of record class

  • Move ranking by column split to a helper function


(cherry picked from commit 5523932)

Related Issues

Resolves #399

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

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.

* WIP: Make poc implementation for chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Support param useother and otherstr

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Support usenull and nullstr (when both row split and col split present)

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Append a final aggregation to merge OTHER categories

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Handle common agg functions for OTHER category for timechart

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Fix timechart IT

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Sort earliest results with asc order

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Support non-string fields as column split

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Fix min/earliest order & fix non-accumulative agg for chart

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Hint non-null in aggregateWithTrimming

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add integration tests for chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add unit tests

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add doc for chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Prompt users that multiple agg is not supported

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add explain ITs

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Remove unimplemented support for multiple aggregations in chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add unit tests for chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Remove irrelevant yaml test

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Tweak chart.rst

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Swap the order of chart output to ensure metrics come last

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Filter rows without col split when calculate grand total

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Chores: tweak code order

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Add anonymize test to chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Change grammart from limit=top 10 to limit=top10

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Update chart doc

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Rename __row_number__ for chart to _row_number_chart_

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Sort by row and col splits on top of chart results

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Ignore rows without a row split in chart command

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Keep categories with max summed values when top k is set

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Simplify toAddHintsOnAggregate condition

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Chores: eliminate unnecessary variables

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Apply a non-null filter on fields referred by aggregations

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Fix chart plans

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Get rid of record class

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

* Move ranking by column split to a helper function

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>

---------

Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
(cherry picked from commit 5523932)
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
@yuancu yuancu force-pushed the backport/backport-4579-to-2.19-dev branch from 3e14b2f to cb5fe97 Compare November 10, 2025 03:15
@LantaoJin LantaoJin merged commit 8ead12a into opensearch-project:2.19-dev Nov 10, 2025
45 checks passed
@yuancu yuancu deleted the backport/backport-4579-to-2.19-dev branch November 10, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants