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

Add validation for unsupported type/identifier/commands #3195

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

ykmr1224
Copy link
Collaborator

@ykmr1224 ykmr1224 commented Dec 5, 2024

Description

  • Add validation for unsupported type/identifier/commands
    • Those grammars are defined but considered unsupported

Related Issues

#3185

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Just curious if it's defined as unsupported in grammar for all data sources, why we still want them in grammar?

Copy link
Member

@YANG-DB YANG-DB left a comment

Choose a reason for hiding this comment

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

@ykmr1224
can we auto-generate the SQLGrammarElement & PPLGrammarElement automatically using the ANTLR files ?

@ykmr1224
Copy link
Collaborator Author

ykmr1224 commented Dec 6, 2024

Just curious if it's defined as unsupported in grammar for all data sources, why we still want them in grammar?

Those are coming from Spark SQL grammar, which we don't want to touch considering when we upgrade Spark version.
I'm not quite sure the original intention in Spark repository, but it might be to raise error as unsupported type instead of parse error.

@ykmr1224
Copy link
Collaborator Author

ykmr1224 commented Dec 6, 2024

@ykmr1224 can we auto-generate the SQLGrammarElement & PPLGrammarElement automatically using the ANTLR files ?

I considered that option initially, but the grammar file contains lots of elements, where same grammar element can be define as multiple way in g4 file. That could lead to very redundant configuration. Also the error message would need to use node name in g4 file, which would become very unclear for users.

@ykmr1224 ykmr1224 merged commit 8bfa2e9 into opensearch-project:main Dec 16, 2024
14 of 15 checks passed
@ykmr1224 ykmr1224 added enhancement New feature or request backport 2.x labels Dec 16, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 16, 2024
Signed-off-by: Tomoyuki Morita <[email protected]>
(cherry picked from commit 8bfa2e9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ykmr1224 pushed a commit that referenced this pull request Dec 16, 2024
(cherry picked from commit 8bfa2e9)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants