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 INSTR to Doris parsing support (#31508) #33289

Merged
merged 4 commits into from
Oct 20, 2024
Merged

Conversation

danigiri
Copy link
Contributor

@danigiri danigiri commented Oct 17, 2024

As part of hacktoberfest, this is a POC for adding more parsing logic to Doris support. If this is successful, I will look at the other Doris SQL keywords in subsequent PRs. Continues to address #31508.

Note that

  • Doris: SELECT INSTR('foobar','bar')
  • MySQL: SELECT POSITION('bar' IN 'foobar') and SELECT LOCATE('bar','foobar') are the equivalent

I understand that I cannot add the labels to the PR and maintainers have to do it.

Changes proposed in this pull request:

Next


Before committing this PR, I'm sure that I have checked the following options:

  • [✅] My code follows the code of conduct of this project.
  • [✅] I have self-reviewed the commit code.
  • [✅] I have (or in comment I request) added corresponding labels for the pull request.
  • [✅] I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • [✅ ] I have made corresponding changes to the documentation (release notes)
  • [✅] I have added corresponding unit tests for my changes.
  • [✅] mvn spotless:apply -Pcheck
  • [✅] mvn test -Dtest=InternalDorisParserIT in shardingsphere/parser/sql/dialect/doris
  • [✅] Executed test case in Doris v2.0.3 – SELECT INSTR('foobar','bar')

- related to apache#31508
- includes test
- `mvn spotless:apply -Pcheck` and `mvn test -Dtest=InternalDorisParserIT`
- will update release notes in next commit
- will check if MySQL supports INSTR in next commit
- verified query in Doris
Small additional changes:
- Also moved the java code to match the order in g4 more.
- Added missing import as well.
@danigiri danigiri changed the title Added BITXOR to Doris parsing support (#31508) Added INSTR to Doris parsing support (#31508) Oct 17, 2024
Also added missing `// DORIS ADDED BEGIN|END` marker
@danigiri danigiri marked this pull request as ready for review October 17, 2024 14:02
Copy link
Member

@strongduanmu strongduanmu left a comment

Choose a reason for hiding this comment

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

@danigiri Thank you for your great job, merged.

@strongduanmu strongduanmu merged commit 4e80d25 into apache:master Oct 20, 2024
141 checks passed
@strongduanmu strongduanmu added this to the 5.5.2 milestone Oct 20, 2024
@danigiri danigiri deleted the dev branch October 21, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants