forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix expression rewrite (vesoft-inc#498)
<!-- Thanks for your contribution! In order to review PR more efficiently, please add information according to the template. --> #### What type of PR is this? - [x] bug - [ ] feature - [x] enhancement #### What problem does this PR solve? Issue(s) number: Fix vesoft-inc#3248 Description: This PR fixes `filterTransform()` and adds cases. #### How do you slove it? 1. Do not transfer the filter expression if it contains 2 different tagProp expressions i.e. `v.player.name =="abc" && v.player.age == 30` 2. Fix expression overflow check. Do not rewrite the expression if it would cause an overflow. 3. Refactor `rewriteRelExpr()` 4. Return semantic error when the non-addition arithmetic expression contains strings. #### Special notes for your reviewer, ex. impact of this fix, design document, etc: ``` (root@nebula) [nba]> match (v:player) where v.player.name+'n'=="Tim Duncann" return v +-----------------------------------------------------+ | v | +-----------------------------------------------------+ | ("Tim Duncan" :player{age: 42, name: "Tim Duncan"}) | +-----------------------------------------------------+ Got 1 rows (time spent 5509/5861 us) Fri, 31 Dec 2021 22:51:01 CST (root@nebula) [NBA]> match (v:player) where v.player.name-'n'=="Tim Duncann" return v `(v.player.name-"n")' is not a valid expression, can not apply `-' to `__EMPTY__' and `STRING'. Fri, 31 Dec 2021 22:51:08 CST ``` #### Checklist: Tests: - [x] Unit test(positive and negative cases) - [ ] Function test - [ ] Perfomance test - [ ] N/A Affects: - [ ] Documentation affected (Please add the label if documentation needs to be modified.) - [ ] Incompatibility (If it breaks the compatibility, please describe it and add the label.) - [ ] If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).) - [ ] Performance impacted: Consumes more CPU/Memory #### Release notes: Please confirm whether to be reflected in release notes and how to describe: > ex. Fixed the bug ..... Migrated from vesoft-inc#3614 Co-authored-by: Yichen Wang <[email protected]>
- Loading branch information
1 parent
c5a36f9
commit 59cbc90
Showing
9 changed files
with
214 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.