-
Notifications
You must be signed in to change notification settings - Fork 193
Support Streamstats command with calcite
#4297
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
Merged
qianheng-aws
merged 34 commits into
opensearch-project:main
from
ishaoxy:streamstats-command
Nov 4, 2025
Merged
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3d828a8
support streamstats simply
ishaoxy 5f4124c
add some tests
ishaoxy 9f726b8
add UT
ishaoxy 089480b
fix some error
ishaoxy 1228778
fix conflicts
ishaoxy 06e2c6a
add global
ishaoxy 5fd9fe6
implement global
ishaoxy 223b15e
implement reset
ishaoxy a7d8d48
implement all the arguments
ishaoxy cd56840
fix test
ishaoxy 4f4376c
add all IT, UT and rst doc
ishaoxy 5eeef46
Merge branch 'main' into streamstats-command
ishaoxy d80b37d
fix anonymizer test
ishaoxy da99024
fix doctest
ishaoxy 37a7944
fix conflict
ishaoxy 63b0157
modify doc and IT
ishaoxy 4b4e912
add explainIT
ishaoxy 8208a95
Merge branch 'main' into streamstats-command
ishaoxy 02182cb
fix import
ishaoxy d12932e
fix typo
ishaoxy b052817
fix doctest
ishaoxy ffd4ecf
fix explainIT yaml format
ishaoxy 3cf6c06
fix dc nopushdown explainIT
ishaoxy 2601cac
add explainIT for path2 and path3
ishaoxy 7be0782
typo error
ishaoxy 7324bcc
Merge branch 'main' into streamstats-command
yuancu 09c77a8
handle resort case
ishaoxy e911fec
fix IT
ishaoxy 82713d2
change row_num
ishaoxy 50df38e
Merge branch 'main' into streamstats-check
ishaoxy 197879a
Rule out aggregator from PPLAggregateMergeRule
ishaoxy bcc28dc
Rule out aggregator from PPLAggregateMergeRule
ishaoxy d33854b
fix conflict streamstats row_num name in PlanUtils
ishaoxy 6c5adfa
fix explainIT
ishaoxy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
71 changes: 71 additions & 0 deletions
71
core/src/main/java/org/opensearch/sql/ast/tree/StreamWindow.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package org.opensearch.sql.ast.tree; | ||
|
|
||
| import com.google.common.collect.ImmutableList; | ||
| import java.util.List; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.Getter; | ||
| import lombok.ToString; | ||
| import org.opensearch.sql.ast.AbstractNodeVisitor; | ||
| import org.opensearch.sql.ast.expression.UnresolvedExpression; | ||
|
|
||
| @Getter | ||
| @ToString | ||
| @EqualsAndHashCode(callSuper = false) | ||
| public class StreamWindow extends UnresolvedPlan { | ||
|
|
||
| private final List<UnresolvedExpression> windowFunctionList; | ||
| private final List<UnresolvedExpression> groupList; | ||
| private final boolean current; | ||
| private final int window; | ||
| private final boolean global; | ||
| private final UnresolvedExpression resetBefore; | ||
| private final UnresolvedExpression resetAfter; | ||
| @ToString.Exclude private UnresolvedPlan child; | ||
|
|
||
| /** StreamWindow Constructor. */ | ||
| public StreamWindow( | ||
| List<UnresolvedExpression> windowFunctionList, | ||
| List<UnresolvedExpression> groupList, | ||
| boolean current, | ||
| int window, | ||
| boolean global, | ||
| UnresolvedExpression resetBefore, | ||
| UnresolvedExpression resetAfter) { | ||
| this.windowFunctionList = windowFunctionList; | ||
| this.groupList = groupList; | ||
| this.current = current; | ||
| this.window = window; | ||
| this.global = global; | ||
| this.resetBefore = resetBefore; | ||
| this.resetAfter = resetAfter; | ||
| } | ||
|
|
||
| public boolean isCurrent() { | ||
| return current; | ||
| } | ||
|
|
||
| public boolean isGlobal() { | ||
| return global; | ||
| } | ||
|
|
||
| @Override | ||
| public StreamWindow attach(UnresolvedPlan child) { | ||
| this.child = child; | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public List<UnresolvedPlan> getChild() { | ||
| return this.child == null ? ImmutableList.of() : ImmutableList.of(this.child); | ||
| } | ||
|
|
||
| @Override | ||
| public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) { | ||
| return nodeVisitor.visitStreamWindow(this, context); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.