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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to