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

Added design for core refactor #331

Open
wants to merge 1 commit into
base: integ-core-refactor-docs
Choose a base branch
from

Conversation

GumpacG
Copy link

@GumpacG GumpacG commented Aug 8, 2023

Description

Proposal for refactoring core to remove OpenSearch specific functions.

Issues Resolved

opensearch-project#811

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • 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.

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #331 (955a415) into integ-core-refactor-docs (d144706) will not change coverage.
The diff coverage is n/a.

@@                     Coverage Diff                     @@
##             integ-core-refactor-docs     #331   +/-   ##
===========================================================
  Coverage                       97.42%   97.42%           
  Complexity                       4647     4647           
===========================================================
  Files                             408      408           
  Lines                           11526    11526           
  Branches                          839      839           
===========================================================
  Hits                            11229    11229           
  Misses                            290      290           
  Partials                            7        7           
Flag Coverage Δ
sql-engine 97.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

```

```mermaid
flowchart LR
Copy link
Author

Choose a reason for hiding this comment

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

Which is the preferred diagram here? Sequence or flowchart?

Choose a reason for hiding this comment

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

Both are fine

```

```mermaid
flowchart LR

Choose a reason for hiding this comment

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

Both are fine


# 2. Requirements

Resolve https://github.com/opensearch-project/sql/issues/811

Choose a reason for hiding this comment

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

Please, add more info. Probably, describe a user story with this feature implemented: plugin for plugin case. It also add dependency clean up and extensibility.

Choose a reason for hiding this comment

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

Please, rename, core refactor is too common.

@@ -0,0 +1,71 @@
# 1. Overview

Choose a reason for hiding this comment

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

Add an abstract, title or intro.

Core LogicalPlanOptimizer ->> #8249;DataSource#8250; LogicalPlanOptimizer: getList()
#8249;DataSource#8250; LogicalPlanOptimizer -->> Core LogicalPlanOptimizer: Datasource specific rules list
Core LogicalPlanOptimizer -->> Planner: LogicalPlan
```

Choose a reason for hiding this comment

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

Describe:

  1. discovered DS interfaces, for example:
    • parse for UDF
    • parse for identifier
    • analyze, optimize, etc
  2. API to plug/attach new DS on runtime
  3. how parser with UDF should work
  4. algorithm of resolution of a DS for a query with examples; consider tricky examples, when UDF or identifier exists in multiple DS
  5. override policy and workflow (in case if a DS overrides a built-in function), or if it is prohibited - how it is checked
  6. Query processing flow and response if UDF/identifier isn't resolved


# 2. Requirements

Resolve https://github.com/opensearch-project/sql/issues/811

Choose a reason for hiding this comment

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

Does this resolve the entire issue? According to opensearch-project#811 (comment), I believe this only resolves core functions. But does it also refactor the parser and pull out the push-down functions?

Choose a reason for hiding this comment

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

In other words, I think we need to list exactly what we are resolving as part of issue opensearch-project#811.

@@ -0,0 +1,71 @@
# 1. Overview

Choose a reason for hiding this comment

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

Can we name this file a bit more specifically? I think core-refactor doesn't describe the changes or objectives accurately enough.


- Using data sources other than OpenSearch, users will encounter a `SyntaxCheckException` when they query with OpenSearch specific functions. (Some of these functions can be found in https://opensearch.org/docs/latest/search-plugins/sql/sql/functions/)
- The Parser will have a different token to categorize OpenSearch functions.
- Core module will no longer contain OpenSearch functions.

Choose a reason for hiding this comment

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

This is the #1 goal, right?
Everything is a by-product of getting the functions out of the core module.

## 2.2 Functional change

- Using data sources other than OpenSearch, users will encounter a `SyntaxCheckException` when they query with OpenSearch specific functions. (Some of these functions can be found in https://opensearch.org/docs/latest/search-plugins/sql/sql/functions/)
- The Parser will have a different token to categorize OpenSearch functions.

Choose a reason for hiding this comment

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

This is a architectural design element, not functional. The users won't see this, nor is this a requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants