Skip to content

Fix antlr4 parser issues#3492

Merged
LantaoJin merged 2 commits into
opensearch-project:mainfrom
LantaoJin:pr/issues/3491
Apr 7, 2025
Merged

Fix antlr4 parser issues#3492
LantaoJin merged 2 commits into
opensearch-project:mainfrom
LantaoJin:pr/issues/3491

Conversation

@LantaoJin
Copy link
Copy Markdown
Member

@LantaoJin LantaoJin commented Mar 31, 2025

Description

  1. Fix incorrect reserved words.
  2. Fix lowercase antlr4 parser issue. (mentioned in [BUG] Issues in PPL grammar #3391)

Related Issues

Resolves #3491

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.

Signed-off-by: Lantao Jin <ltjin@amazon.com>
@LantaoJin
Copy link
Copy Markdown
Member Author

cc @noCharger @penghuo @dai-chen

Signed-off-by: Lantao Jin <ltjin@amazon.com>
@LantaoJin
Copy link
Copy Markdown
Member Author

CI failure related to opensearch-project/job-scheduler#757

Comment thread ppl/src/main/antlr/OpenSearchPPLLexer.g4
Comment on lines -1051 to -1054
| EARLIEST
| EARLIEST_TIME
| LATEST
| LATEST_TIME
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why remove this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Those keywords are not present in lexer.g4, another words, they are invalid here.

Comment on lines +998 to +1000
| VARIABLE_COUNT_THRESHOLD
| FREQUENCY_THRESHOLD_PERCENTAGE
| WITH
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

@LantaoJin LantaoJin Apr 7, 2025

Choose a reason for hiding this comment

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

Just confirming, do we need these in https://github.com/opensearch-project/opensearch-spark/blob/main/ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4 as well?

No for first two. WITH has already be presented in ppl-spark.

@LantaoJin LantaoJin merged commit d9ef4fa into opensearch-project:main Apr 7, 2025
18 of 22 checks passed
penghuo pushed a commit that referenced this pull request Jun 16, 2025
* Fix antlr4 parser issues

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* Case insensitive lexer

Signed-off-by: Lantao Jin <ltjin@amazon.com>

---------

Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ANTLR4 Grammar issues

4 participants