-
Notifications
You must be signed in to change notification settings - Fork 141
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
Implement SQL validation based on grammar element #3039
Implement SQL validation based on grammar element #3039
Conversation
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
c44d89f
to
11ca4ff
Compare
async-query-core/build.gradle
Outdated
@@ -130,7 +130,7 @@ jacocoTestCoverageVerification { | |||
} | |||
limit { | |||
counter = 'BRANCH' | |||
minimum = 1.0 | |||
minimum = 0.9 |
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.
Reduced since there was a branch which could not be covered due to Spark SQL grammar.
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.
Can we add it to the exclude list above instead of reducing this on entire module?
...c-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidationVisitor.java
Show resolved
Hide resolved
async-query-core/src/main/java/org/opensearch/sql/spark/validator/FunctionType.java
Show resolved
Hide resolved
...ery-core/src/main/java/org/opensearch/sql/spark/validator/S3GlueGrammarElementValidator.java
Show resolved
Hide resolved
HINTS, | ||
INLINE_TABLE, | ||
FILE, | ||
CROSS_JOIN, |
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.
disable Join? why?
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.
It is because those joins are expensive.
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.
PPL add JOIN support with ALL join types. https://github.com/opensearch-project/opensearch-spark/blob/main/docs/PPL-Join-command.md
We should align PPL and SQL capability.
Signed-off-by: Tomoyuki Morita <[email protected]>
Signed-off-by: Tomoyuki Morita <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3039 +/- ##
============================================
+ Coverage 94.33% 94.43% +0.10%
- Complexity 5278 5387 +109
============================================
Files 519 528 +9
Lines 15002 15305 +303
Branches 1005 1010 +5
============================================
+ Hits 14152 14454 +302
Misses 804 804
- Partials 46 47 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Filed a issue for update/test spark version: #3041 |
Signed-off-by: Tomoyuki Morita <[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.
Thx!
async-query-core/build.gradle
Outdated
@@ -130,7 +130,7 @@ jacocoTestCoverageVerification { | |||
} | |||
limit { | |||
counter = 'BRANCH' | |||
minimum = 1.0 | |||
minimum = 0.9 |
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.
Can we add it to the exclude list above instead of reducing this on entire module?
...ery-core/src/main/java/org/opensearch/sql/spark/validator/S3GlueGrammarElementValidator.java
Show resolved
Hide resolved
Signed-off-by: Tomoyuki Morita <[email protected]>
* Implement SQL validation based on grammar element Signed-off-by: Tomoyuki Morita <[email protected]> * Add function types Signed-off-by: Tomoyuki Morita <[email protected]> * fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Add security lake Signed-off-by: Tomoyuki Morita <[email protected]> * Add File support Signed-off-by: Tomoyuki Morita <[email protected]> * Integrate into SparkQueryDispatcher Signed-off-by: Tomoyuki Morita <[email protected]> * Fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Add tests Signed-off-by: Tomoyuki Morita <[email protected]> * Integration Signed-off-by: Tomoyuki Morita <[email protected]> * Add comments Signed-off-by: Tomoyuki Morita <[email protected]> * Address comments Signed-off-by: Tomoyuki Morita <[email protected]> * Allow join types for now Signed-off-by: Tomoyuki Morita <[email protected]> * Fix style Signed-off-by: Tomoyuki Morita <[email protected]> * Fix coverage check Signed-off-by: Tomoyuki Morita <[email protected]> --------- Signed-off-by: Tomoyuki Morita <[email protected]> (cherry picked from commit a87893a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR reminds me of another PR #2781 which is an implementation the Aggregate validation based on grammar. I haven't go through the whole details of this PR. Does this PR could resolve the problems described in #2781 (comment)? @ykmr1224 @penghuo |
* Implement SQL validation based on grammar element * Add function types * fix style * Add security lake * Add File support * Integrate into SparkQueryDispatcher * Fix style * Add tests * Integration * Add comments * Address comments * Allow join types for now * Fix style * Fix coverage check --------- (cherry picked from commit a87893a) Signed-off-by: Tomoyuki Morita <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No, I think #2781 is for query executed in SQL plugin, but this PR is for async-query. And it is rather prohibiting grammar elements available in Spark SQL. |
Description
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.