Skip to content

[Backport 2.19-dev] Support timechart command with Calcite (#3993) - #4232

Merged
qianheng-aws merged 2 commits into
opensearch-project:2.19-devfrom
selsong:backport/backport-3993-to-2.19-dev
Sep 5, 2025
Merged

qianheng-aws merged 2 commits into
opensearch-project:2.19-devfrom
selsong:backport/backport-3993-to-2.19-dev

Conversation

@selsong

@selsong selsong commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

Description

Backport #3993 timechart PR into 2.19-dev branch
manual backport due to conflict

* WIP: Support timechart grammar / AST

Signed-off-by: Selina Song <[email protected]>

* WIP: Support span=unit in timechart

Signed-off-by: Selina Song <[email protected]>

* Return correct column format after span=unit

Signed-off-by: Selina Song <[email protected]>

* sort by @timestamp, group by aggregate function

Signed-off-by: Selina Song <[email protected]>

* WIP: pivot table by field

Signed-off-by: Selina Song <[email protected]>

* Correct pivot format for by field

Signed-off-by: Selina Song <[email protected]>

* Fix aggregation composite bucket limit
Signed-off-by: Selina Song <[email protected]>

* Add timechart.rst doc and PPLQueryAnonymizer test

Signed-off-by: Selina Song <[email protected]>

* Add ExplainIT for timechart

Signed-off-by: Selina Song <[email protected]>

* Restore reverse ExplainIT

Signed-off-by: Selina Song <[email protected]>

* Update explainIT timechart

Signed-off-by: Selina Song <[email protected]>

* spotlessApply formatting

Signed-off-by: Selina Song <[email protected]>

* format IT

Signed-off-by: Selina Song <[email protected]>

* Add limit parameter

Signed-off-by: Selina Song <[email protected]>

* Add limit=0 means no limit, show all values, no other

Signed-off-by: Selina Song <[email protected]>

* Add useother parameter

Signed-off-by: Selina Song <[email protected]>

* clean up format, fix column order

Signed-off-by: Selina Song <[email protected]>

* add test for formatter

Signed-off-by: Selina Song <[email protected]>

* Increase test coverage for formatter

Signed-off-by: Selina Song <[email protected]>

* Rename bin option expression, modify constructor

Signed-off-by: Selina Song <[email protected]>

* Make test data smaller, update IT, rst

Signed-off-by: Selina Song <[email protected]>

* add explain output to IT

Signed-off-by: Selina Song <[email protected]>

* Add limitation to rst, format, comment

Signed-off-by: Selina Song <[email protected]>

* Add test coverage formatter

Signed-off-by: Selina Song <[email protected]>

* Refactor formatter for clarity

Signed-off-by: Selina Song <[email protected]>

* fix NPE

Signed-off-by: Selina Song <[email protected]>

* add import

Signed-off-by: Selina Song <[email protected]>

* update mapping to match smaller dataset

Signed-off-by: Selina Song <[email protected]>

* update explainIT

Signed-off-by: Selina Song <[email protected]>

* Fix explainIT, improve code structure

Signed-off-by: Selina Song <[email protected]>

* spotless

Signed-off-by: Selina Song <[email protected]>

* Support diff position parameters, count default 0 not null, update doc rst

Signed-off-by: Selina Song <[email protected]>

* fix count aggr type int

Signed-off-by: Selina Song <[email protected]>

* rename @timestamp column

Signed-off-by: Selina Song <[email protected]>

* move parameter extraction to PPLService

Signed-off-by: Selina Song <[email protected]>

* clean up PPLService

Signed-off-by: Selina Song <[email protected]>

* fix count type test, doc rst format

Signed-off-by: Selina Song <[email protected]>

* add test coverage

Signed-off-by: Selina Song <[email protected]>

* WIP: SQL query with limit useother

Signed-off-by: Selina Song <[email protected]>

* revert QueryService

Signed-off-by: Selina Song <[email protected]>

* add limit useother to SQL query

Signed-off-by: Selina Song <[email protected]>

* SQL query working, WIP column rename

Signed-off-by: Selina Song <[email protected]>

* use loadIndex in IT

Signed-off-by: Selina Song <[email protected]>

* Rename fields to match, update doc

Signed-off-by: Selina Song <[email protected]>

* revert QueryResult

Signed-off-by: Selina Song <[email protected]>

* revert gradle build

Signed-off-by: Selina Song <[email protected]>

* fix format

Signed-off-by: Selina Song <[email protected]>

* Add count fill zero, update toSQL tests, doc

Signed-off-by: Selina Song <[email protected]>

* fix nits

Signed-off-by: Selina Song <[email protected]>

* Fix rename aggregation only no by field

Signed-off-by: Selina Song <[email protected]>

* Update SQL test

Signed-off-by: Selina Song <[email protected]>

* revert OS Exec Engine edits

Signed-off-by: Selina Song <[email protected]>

* correct OS Exec Engine revert to 5ec9603

Signed-off-by: Selina Song <[email protected]>

* restore OS Exec Engine

Signed-off-by: Selina Song <[email protected]>

* update QueryAnonymizer Test to reflect default

Signed-off-by: Selina Song <[email protected]>

* WIP: Add null=1, Other fill zero wip

Signed-off-by: Selina Song <[email protected]>

* Add doctest and update ExplainIT

Signed-off-by: Selina Song <[email protected]>

* Replace detectFieldIndices function

Signed-off-by: Selina Song <[email protected]>

* update explainIT

Signed-off-by: Selina Song <[email protected]>

* Fix Other in zero fill case

Signed-off-by: Selina Song <[email protected]>

* Fix OTHER in zero fill case

Signed-off-by: Selina Song <[email protected]>

* spotless format

Signed-off-by: Selina Song <[email protected]>

* update doc with null example

Signed-off-by: Selina Song <[email protected]>

* null not included in limit calc

Signed-off-by: Selina Song <[email protected]>

* update SQL test

Signed-off-by: Selina Song <[email protected]>

* update SQL test format

Signed-off-by: Selina Song <[email protected]>

* Update ExplainIT with count

Signed-off-by: Selina Song <[email protected]>

* remove unused code

Signed-off-by: Selina Song <[email protected]>

* Fix SQL tests nullable

Signed-off-by: Selina Song <[email protected]>

* spotless format

Signed-off-by: Selina Song <[email protected]>

---------

Signed-off-by: Selina Song <[email protected]>
Signed-off-by: Selina Song <[email protected]>
Co-authored-by: Selina Song <[email protected]>
(cherry picked from commit e2678a1)
@selsong
selsong force-pushed the backport/backport-3993-to-2.19-dev branch from 370b35d to f6469d0 Compare September 4, 2025 23:24
Signed-off-by: Selina Song <[email protected]>
@qianheng-aws
qianheng-aws merged commit f662af8 into opensearch-project:2.19-dev Sep 5, 2025
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