-
Notifications
You must be signed in to change notification settings - Fork 177
Support 'usenull' option in PPL top and rare commands
#4696
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
Support 'usenull' option in PPL top and rare commands
#4696
Conversation
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
| * When ``plugins.ppl.syntax.legacy.preferred=true``, ``usenull`` defaults to ``true`` | ||
| * When ``plugins.ppl.syntax.legacy.preferred=false``, ``usenull`` defaults to ``false`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bullet points in blockquote, is it expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Keep the format same with the current stats.rst. I tried to use the new format to align with Update PPL Command Documentation. But seems there are still many format problems in that PR. ref
|
The backport to 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-4696-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c6a5fb9762aed964fe56513b80a55f35934b0255
# Push it to GitHub
git push --set-upstream origin backport/backport-4696-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
| context.relBuilder.filter( | ||
| PlanUtils.getSelectColumns(groupByList).stream() | ||
| .map(context.relBuilder::field) | ||
| .map(context.relBuilder::isNotNull) | ||
| .toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not apply isNotNull directly on groupByList, but on their underlying input ref? If some operation converts a null field to a non-null one, I think it should not be filtered out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuancu
Think about query:
| eval a = nullif(status, "200") | stats bucket_nullable = false count() by a
The groupByList contains RexCall "AS($9, 'a')". So we finally build a
context.relBuilder.filter(isNotNull($9)) which $9 is nullif(status, "200") instead of status
…-project#4696) * Support 'usenull' option in PPL top and rare commands Signed-off-by: Lantao Jin <[email protected]> * fix the incorrect naming Signed-off-by: Lantao Jin <[email protected]> --------- Signed-off-by: Lantao Jin <[email protected]> (cherry picked from commit c6a5fb9)
…commands (#4696) (#4702) * Support 'usenull' option in PPL `top` and `rare` commands (#4696) * Support 'usenull' option in PPL top and rare commands Signed-off-by: Lantao Jin <[email protected]> * fix the incorrect naming Signed-off-by: Lantao Jin <[email protected]> --------- Signed-off-by: Lantao Jin <[email protected]> (cherry picked from commit c6a5fb9) * fix compile error Signed-off-by: Lantao Jin <[email protected]> * fix compile error Signed-off-by: Lantao Jin <[email protected]> --------- Signed-off-by: Lantao Jin <[email protected]>
Description
usenullis determined byplugins.ppl.syntax.legacy.preferred:plugins.ppl.syntax.legacy.preferred=true,usenulldefaults totrueplugins.ppl.syntax.legacy.preferred=false,usenulldefaults tofalseSee #4684 for examples.
Related Issues
Resolves #4684
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.