-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve](syntax) compatiable with mysql MOD syntax #58432
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
1 similar comment
|
run buildall |
4899ef5 to
e00ccc7
Compare
|
run buildall |
TPC-H: Total hot run time: 34467 ms |
TPC-DS: Total hot run time: 184706 ms |
ClickBench: Total hot run time: 27.84 s |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
|
run performance |
|
run p0 |
TPC-H: Total hot run time: 34859 ms |
TPC-DS: Total hot run time: 184094 ms |
ClickBench: Total hot run time: 27.22 s |
FE Regression Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
### What problem does this PR solve?
This PR improves compatibility with MySQL arithmetic expression syntax,
allow user use `%` and `MOD` to represent modular semantics.
Note that the `MOD` is a non-reserved keyword, can be used in arithmetic
expressions, MOD function name or to represent aliases in as statements.
before:
```sql
SELECT 10 MOD 3 as mod;
ERROR 1105 (HY000): errCode = 2, detailMessage =
mismatched input '3' expecting {<EOF>, ';'}(line 1, pos 19)
```
after:
```sql
mysql> SELECT 10 MOD 3 as mod;
+------+
| mod |
+------+
| 1 |
+------+
```
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
### What problem does this PR solve?
This PR improves compatibility with MySQL arithmetic expression syntax,
allow user use `%` and `MOD` to represent modular semantics.
Note that the `MOD` is a non-reserved keyword, can be used in arithmetic
expressions, MOD function name or to represent aliases in as statements.
before:
```sql
SELECT 10 MOD 3 as mod;
ERROR 1105 (HY000): errCode = 2, detailMessage =
mismatched input '3' expecting {<EOF>, ';'}(line 1, pos 19)
```
after:
```sql
mysql> SELECT 10 MOD 3 as mod;
+------+
| mod |
+------+
| 1 |
+------+
```
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
What problem does this PR solve?
This PR improves compatibility with MySQL arithmetic expression syntax, allow user use
%andMODto represent modular semantics.Note that the
MODis a non-reserved keyword, can be used in arithmetic expressions, MOD function name or to represent aliases in as statements.before:
after:
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)