suxiaogang223 opened a new pull request, #69987:
URL: https://github.com/apache/doris/pull/69987

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: None
   
   Problem Summary:
   
   JDBC SQL rendering loses expression boundaries when a compound expression is 
used as an operand. For example, `(a AND b) = c` becomes `a AND b = c`. With 
`a=false, b=true, c=false`, the source filters out a matching row before Doris 
can evaluate its residual predicate.
   
   Floating-point literal rendering also narrows integral-looking doubles to 
`long`. A predicate against `1e20` is sent to the source with 
`9223372036854775807`, changing its meaning and potentially losing rows.
   
   This change:
   - Groups compound operands consistently in comparisons, IN, IS NULL, 
LIKE/REGEXP, BETWEEN, and arithmetic expressions.
   - Serializes finite floating-point values without narrowing to long.
   - Keeps empty IN lists and non-finite literals local and suppresses remote 
LIMIT when a filter cannot be translated.
   - Adds 12 unit tests covering nested operands, NULL-related grouping, 
floating-point boundaries and adjacent values, signed zero, and local-filter 
fallback.
   
   ### Release note
   
   Fix JDBC predicate pushdown that can miss matching rows due to expression 
precedence changes or out-of-range floating-point literal conversion.
   
   ### Check List (For Author)
   
   - Test
       - [ ] Regression test
       - [x] Unit Test
           - `bash run-fe-ut.sh --run 
org.apache.doris.connector.jdbc.JdbcQueryBuilderTest`: BUILD SUCCESS; all 89 
reactor modules completed their compilation/test phases; the selected class ran 
48 tests with 0 failures, 0 errors, and 0 skipped.
           - Checkstyle: 0 violations in both changed files.
           - Connector import boundary check and `git diff --check`: passed.
           - The standard `bash build.sh --fe -j4` distribution build stopped 
at native third-party prerequisites because the local installation is 
incomplete and its rebuild requires missing LLVM 20. The successful FE 
unit-test entry point compiled the Java modules with JDK 17, Thrift 0.24.0, and 
protoc 3.21.11. No FE distribution package or cluster end-to-end validation is 
claimed.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Preserve operand grouping and floating-point values in pushed 
predicates; keep unsupported literal/list forms local.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to