You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2026/05/17 08:35:49 UTC

[PR] [AMORO-4420] [Improvement] Support BETWEEN and reversed comparison SQL filters in ExpressionUtil. [amoro]

slfan1989 opened a new pull request, #4221:
URL: https://github.com/apache/amoro/pull/4221

   
   
   ## Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about its use case.
     2. If you fix a bug, you can clarify why it is a bug.
     3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
   -->
   
   Close #4420.
   
   `ExpressionUtil.convertSqlFilterToIcebergExpression()` currently supports basic SQL filters only when the table column is on the left side of a comparison, such as `column_a > 1`.
   
   However, some valid SQL filter forms are not supported yet:
   
   - `column_a BETWEEN 1 AND 10`
   - `column_a NOT BETWEEN 1 AND 10`
   - `1 < column_a`
   - `1 <= column_a`
   
   These expressions are common in SQL predicates. Supporting them makes SQL filter conversion more complete and improves compatibility with user-provided filter conditions.
   
   
   ## Brief change log
   
   - Added support for `BETWEEN` and `NOT BETWEEN` in `ExpressionUtil`.
   - Added support for comparison expressions where the column appears on the right side.
   - Added a comparison operator helper to normalize reversed comparisons, for example:
     - `1 < column_a` -> `column_a > 1`
     - `1 >= column_a` -> `column_a <= 1`
   - Added unit tests in `TestExpressionUtil` for:
     - `BETWEEN`
     - `NOT BETWEEN`
     - reversed `>`, `>=`, `<`, `<=`, `=`, and `!=` comparisons
   
   
   ## How was this patch tested?
   
   - [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [X] Run test locally before making a pull request
   
   ## Documentation
   
   - Does this pull request introduce a new feature? yes
   - If yes, how is the feature documented? not documented


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AMORO-4220] [Improvement] Support BETWEEN and reversed comparison SQL filters in ExpressionUtil. [amoro]

Posted by "zhoujinsong (via GitHub)" <gi...@apache.org>.
zhoujinsong merged PR #4221:
URL: https://github.com/apache/amoro/pull/4221


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AMORO-4220] [Improvement] Support BETWEEN and reversed comparison SQL filters in ExpressionUtil. [amoro]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #4221:
URL: https://github.com/apache/amoro/pull/4221#issuecomment-4484570320

   > LGTM.
   > 
   > Thanks a lot for the work!
   
   @zhoujinsong Thanks a lot for the review and for merging this!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org