-
Notifications
You must be signed in to change notification settings - Fork 33
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
Isempty #676
Isempty #676
Conversation
Signed-off-by: Kacper Trochimiak <[email protected]>
Signed-off-by: Kacper Trochimiak <[email protected]>
Signed-off-by: Lukasz Soszynski <[email protected]>
Signed-off-by: Lukasz Soszynski <[email protected]>
Signed-off-by: Lukasz Soszynski <[email protected]>
f806238
to
ddbc4fc
Compare
@@ -557,7 +566,29 @@ public Expression visitKmeans(Kmeans node, CatalystPlanContext context) { | |||
|
|||
@Override | |||
public Expression visitCase(Case node, CatalystPlanContext context) { | |||
throw new IllegalStateException("Not Supported operation : Case"); | |||
analyze(node.getElseClause(), context); |
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.
how is this related to the isEmpty ? can u please elaborate ?
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.
The isempty
function is implemented using the Case
statement. Please see: https://github.com/eliatra/opensearch-spark/blob/c270360f45264b4b1c7d177d5cc405f7c6fc94f0/ppl-spark-integration/src/main/java/org/opensearch/sql/ast/expression/IsEmpty.java#L11
The isempty
function is translated into:
SELECT CASE
WHEN length(trim(column_name)) = 0 THEN true
ELSE false
END AS is_empty
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/opensearch-spark/backport-0.5-nexus 0.5-nexus
# Navigate to the new working tree
pushd ../.worktrees/opensearch-spark/backport-0.5-nexus
# Create a new branch
git switch --create backport/backport-676-to-0.5-nexus
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a7fe6e644b750b1a07294b8104d0fc0ab67287c1
# Push it to GitHub
git push --set-upstream origin backport/backport-676-to-0.5-nexus
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-spark/backport-0.5-nexus Then, create a pull request where the |
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/opensearch-spark/backport-0.5 0.5
# Navigate to the new working tree
pushd ../.worktrees/opensearch-spark/backport-0.5
# Create a new branch
git switch --create backport/backport-676-to-0.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a7fe6e644b750b1a07294b8104d0fc0ab67287c1
# Push it to GitHub
git push --set-upstream origin backport/backport-676-to-0.5
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-spark/backport-0.5 Then, create a pull request where the |
Description
Describe what this change achieves.
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
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.