[CALCITE-7673] Add support for the LIKE operator to the MongoDB adapter - #5131
[CALCITE-7673] Add support for the LIKE operator to the MongoDB adapter#5131xuzifu666 wants to merge 1 commit into
Conversation
0ad29ac to
af646e1
Compare
Dwrite
left a comment
There was a problem hiding this comment.
The caller's switch only registers LIKE, not NOT_LIKE. If NOT LIKE isn't rewritten into NOT(LIKE(...)) earlier in planning, it could also hit the default branch and throw. Suggest adding a city not like 'A%' test to confirm expected behavior.
| } | ||
|
|
||
| /** Test case for LIKE operator with escape character on percent. */ | ||
| @Test void testLikeEscapePercent() { |
There was a problem hiding this comment.
Should you add some NOT LIKE test cases? The switch statement in the caller only handles LIKE, not NOT_LIKE — if NOT LIKE isn't rewritten to NOT(LIKE(...)) before reaching this code, it may fall into the default branch and throw an AssertionError. Worth adding a test like city not like 'A%' to confirm the behavior.
| } | ||
|
|
||
| /** Test case for LIKE operator without a default escape character. */ | ||
| @Test void testLikeNoDefaultEscape() { |
There was a problem hiding this comment.
TranslateLike explicitly handles case ITEM: (nested field / map access), but all 12 current tests exercise only the INPUT_REF path. Since this branch is dedicated code, it's currently completely unverified. Suggest adding at least one case like _MAP['city'] like 'A%' to exercise it.
|
Thank you for the review, I had added MongoDB adapter support for the SQL LIKE operator, including ESCAPE semantics, regex special-character escaping, and NOT LIKE pushdown. PTAL @Dwrite |
|
fd3c61c to
ce88571
Compare



jira: https://issues.apache.org/jira/browse/CALCITE-7673