-
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
PPL command implementation for appendCol
#990
PPL command implementation for appendCol
#990
Conversation
appendCol
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/utils/AppendColCatalystUtils.java
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/utils/AppendColCatalystUtils.java
Outdated
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/utils/AppendColCatalystUtils.java
Outdated
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/utils/AppendColCatalystUtils.java
Outdated
Show resolved
Hide resolved
Two high level questions:
And the sub-search syntax is opensearch-spark/ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4 Lines 27 to 29 in 957de4e
Seems this PR doesn't follow the sub-search syntax. I prefer to follow the current sub-search syntax, in case we could combine columns from different tables. for examples: source=employees | FIELDS name, dept, salary | APPENDCOL [ search source = company | stats count() as event_count ] But if this is intentional (appendcol only works for one table), I am okey for current syntax.
instead of
PS, what is the expected result of query |
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
Yep, the sub-search under |
ppl-spark-integration/src/main/java/org/opensearch/sql/ast/tree/AppendCol.java
Outdated
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
@andy-k-improving I would go with the same behaviour to match with Splunk ... |
@andy-k-improving LGTM - please validate @LantaoJin question and respond here |
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Co-authored-by: Taylor Curran <[email protected]> Signed-off-by: Andy Kwok <[email protected]>
Co-authored-by: Taylor Curran <[email protected]> Signed-off-by: Andy Kwok <[email protected]>
Co-authored-by: Taylor Curran <[email protected]> Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
c44d1b6
to
d6a29fb
Compare
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/utils/AppendColCatalystUtils.java
Show resolved
Hide resolved
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
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.
@andy-k-improving I would like to simplify the method CatalystQueryPlanVisitor.java.visitAppendCol(..)
so its simpler / smaller and move its complexity away into AppendColCatalystUtils
does it make sense ?
On high level, that make sense, however how you foresee the structure will be like on Do you foresee t he logical plan composition flow happen within Ex:
|
Signed-off-by: Andy Kwok <[email protected]>
Signed-off-by: Andy Kwok <[email protected]>
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.
Really appreciate your code revisions and clear explanations, which is improving the code quality. LGTM.
Description
Introduce the new PPL command
appendCol
which aim to aggregate result from multiple searches into a single comprehensive table for user to view.This is accomplished by reading both main-search and sub-search in the form of
node
then transform it into the following of SQL with by adding_row_number_
for the dataset's natural order, then join both main and sub search with the_row_number_
column.Related Issues
Resolves: #956
Check List
--signoff
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.
Test plan: