Skip to content

Conversation

@ishaoxy
Copy link
Contributor

@ishaoxy ishaoxy commented Nov 20, 2025

Description

Similar with stats and eventstats, now we add bucket_nullable argument for streamstats.
ref: #4817

Related Issues

Resolves #4802

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.

// wrap each expr: CASE WHEN groupNotNull THEN rawExpr ELSE CAST(NULL AS rawType) END
List<RexNode> wrappedOverExprs =
wrapWindowFunctionsWithGroupNotNull(overExpressions, groupNotNull, context);
context.relBuilder.projectPlus(wrappedOverExprs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a similar work with following code to add a hint to the Project (A better way is adding hint on LogicalWindow but seems we cannot do it now). So does eventstats. This hint is useful during plan optimizing.

if (hintBucketNonNull) addIgnoreNullBucketHintToAggregate(context);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will try.

yuancu
yuancu previously approved these changes Nov 24, 2025
Copy link
Collaborator

@yuancu yuancu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall

Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
@LantaoJin LantaoJin merged commit f7b860b into opensearch-project:main Nov 26, 2025
35 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19-dev failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4831-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f7b860b62bea308c00dc995c21f81005690443c4
# Push it to GitHub
git push --set-upstream origin backport/backport-4831-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-dev

Then, create a pull request where the base branch is 2.19-dev and the compare/head branch is backport/backport-4831-to-2.19-dev.

@LantaoJin
Copy link
Member

@ishaoxy please backport^

ishaoxy added a commit to ishaoxy/sql that referenced this pull request Nov 27, 2025
ishaoxy added a commit to ishaoxy/sql that referenced this pull request Nov 27, 2025
ishaoxy added a commit to ishaoxy/sql that referenced this pull request Nov 27, 2025
ishaoxy added a commit to ishaoxy/sql that referenced this pull request Nov 27, 2025
@LantaoJin LantaoJin added the backport-manually Filed a PR to backport manually. label Nov 28, 2025
LantaoJin pushed a commit that referenced this pull request Nov 28, 2025
…command (#4879)

* backport #4831

Signed-off-by: Xinyu Hao <[email protected]>

* backport #4831

Signed-off-by: Xinyu Hao <[email protected]>

* backport #4831

Signed-off-by: Xinyu Hao <[email protected]>

* code format

Signed-off-by: Xinyu Hao <[email protected]>

* fields lack

Signed-off-by: Xinyu Hao <[email protected]>

---------

Signed-off-by: Xinyu Hao <[email protected]>
asifabashar pushed a commit to asifabashar/sql that referenced this pull request Dec 10, 2025
…project#4831)

* add bucket_nullable for streamstats

Signed-off-by: Xinyu Hao <[email protected]>

* little change

Signed-off-by: Xinyu Hao <[email protected]>

* fix IT, UT and doc

Signed-off-by: Xinyu Hao <[email protected]>

* fix

Signed-off-by: Xinyu Hao <[email protected]>

* change bucketNullable getOrDefault to get

Signed-off-by: Xinyu Hao <[email protected]>

* fix error

Signed-off-by: Xinyu Hao <[email protected]>

---------

Signed-off-by: Xinyu Hao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.19-dev backport-failed backport-manually Filed a PR to backport manually. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add [bucket_nullable] argument for Streamstats command

3 participants