Skip to content
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

Refactor CatalystQueryPlanVisitor into distinct Plan & Expression visitors #852

Merged

Conversation

YANG-DB
Copy link
Member

@YANG-DB YANG-DB commented Oct 31, 2024

Description

We need to refactor the CatalystQueryPlanVisitor and separate it into two distinct visitors:

  • Plan Visitor ( which extends AbstractNodeVisitor<LogicalPlan, CatalystPlanContext> )
  • Expression Visitor (which extends AbstractNodeVisitor<Expression, CatalystPlanContext>)

This would match the existing PPL AST visitors composition:

  • AstBuilder ( which extends OpenSearchPPLParserBaseVisitor)
  • AstExpressionBuilder ( which extends OpenSearchPPLParserBaseVisitor)

In addition unify the ppl utils classes to match one of the following naming:

  • *Transformer - transforms PPL (logical) expressions into Spark (logical) expressions
  • *Utils - utility class

Related Issues

#851

Check List

  • Updated documentation (docs/ppl-lang/README.md)
  • Implemented unit tests
  • Implemented tests for combination with other commands
  • New added source code should include a copyright header
  • Commits are signed per the DCO using --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.

…t into two distinct visitors:

Plan Visitor ( which extends AbstractNodeVisitor<LogicalPlan, CatalystPlanContext> )
Expression Visitor (which extends AbstractNodeVisitor<Expression, CatalystPlanContext>)
This would match the existing PPL AST visitors composition:

AstBuilder ( which extends OpenSearchPPLParserBaseVisitor)
AstExpressionBuilder ( which extends OpenSearchPPLParserBaseVisitor )
In addition unify the ppl utils classes to match one of the following naming:

*Transformer - transforms PPL (logical) expressions into Spark (logical) expressions
*Utils - utility class

Signed-off-by: YANGDB <[email protected]>
@YANG-DB YANG-DB changed the title We would like to refactor the CatalystQueryPlanVisitor and separate i… Refactor CatalystQueryPlanVisitor into Plan & Expression visitor Oct 31, 2024
@YANG-DB YANG-DB changed the title Refactor CatalystQueryPlanVisitor into Plan & Expression visitor Refactor CatalystQueryPlanVisitor into Plan & Expression visitors Oct 31, 2024
@YANG-DB YANG-DB changed the title Refactor CatalystQueryPlanVisitor into Plan & Expression visitors Refactor CatalystQueryPlanVisitor into distinct Plan & Expression visitors Oct 31, 2024
@YANG-DB YANG-DB added Lang:PPL Pipe Processing Language support 0.6 labels Oct 31, 2024
# Conflicts:
#	ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
@YANG-DB YANG-DB merged commit 98962c3 into opensearch-project:main Oct 31, 2024
4 checks passed
kenrickyap pushed a commit to Bit-Quill/opensearch-spark that referenced this pull request Dec 11, 2024
…isitors (opensearch-project#852)

* We would like to refactor the CatalystQueryPlanVisitor and separate it into two distinct visitors:

Plan Visitor ( which extends AbstractNodeVisitor<LogicalPlan, CatalystPlanContext> )
Expression Visitor (which extends AbstractNodeVisitor<Expression, CatalystPlanContext>)
This would match the existing PPL AST visitors composition:

AstBuilder ( which extends OpenSearchPPLParserBaseVisitor)
AstExpressionBuilder ( which extends OpenSearchPPLParserBaseVisitor )
In addition unify the ppl utils classes to match one of the following naming:

*Transformer - transforms PPL (logical) expressions into Spark (logical) expressions
*Utils - utility class

Signed-off-by: YANGDB <[email protected]>

* update the AstBuilder ctor

Signed-off-by: YANGDB <[email protected]>

* resolve latest merge conflicts

Signed-off-by: YANGDB <[email protected]>

---------

Signed-off-by: YANGDB <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6 Lang:PPL Pipe Processing Language support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants