sky-cc opened a new issue, #27691:
URL: https://github.com/apache/doris/issues/27691

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   2.0.2
   
   ### What's Wrong?
   
   when query sql uses OR ,incorrect results may be returned。Triggered when the 
field of the OR condition contains a numeric type
   
   ### What You Expected?
   
   fix it
   
   ### How to Reproduce?
   
   Executing the following sql will reproduce the problem
   
   SET enable_nereids_planner=true;
    CREATE TABLE `test` (
     `gameid` varchar(50) NOT NULL DEFAULT "",
     `aid` int(11) NOT NULL DEFAULT "0",
     `bid` int(11) NOT NULL DEFAULT "0",
     `cid` int(11) NOT NULL DEFAULT "0",
     `did` int(11) NOT NULL DEFAULT "0",
     `pname` varchar(255) NOT NULL DEFAULT "其他"
   ) ENGINE=OLAP
   UNIQUE KEY(`gameid`, `aid`, `bid`, `cid`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`gameid`) BUCKETS 3
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 3",
   "is_being_synced" = "false",
   "storage_format" = "V2",
   "enable_unique_key_merge_on_write" = "true",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false"
   ); 
   insert into test values('g1', 1,1,1,1,'p1');
   insert into test values('g2', 2,2,2,2,'p2');
   insert into test values('g3', 3,3,3,3,'p3');
   insert into test values('g4', 4,4,4,4,'p4');
    insert into test values('g5', 5,5,5,5,'p5');
   
   ## Executing  the following query sql will return incorrect result 
   SELECT gameid,
          aid,
          cid,
          bid,
          did
   FROM test
   WHERE aid in (1, 2, 3)
     AND (
           (aid = 1 AND gameid IN ('g1'))
           OR (aid = 2 AND gameid IN ('g1', 'g2'))
       )
   GROUP BY gameid,
            aid, cid, bid, did
   
   
![image](https://github.com/apache/doris/assets/64391288/25a09687-3819-4a02-a10a-24411b7fd283)
   
   1.Correct results are returned when nereids are disabled
   SET enable_nereids_planner=false;
   
![image](https://github.com/apache/doris/assets/64391288/c3b4a911-c238-4584-85a8-afc71cd1eb76)
   2.Correct results will be returned when the `aid` field type is character
   3.Incorrect results will be returned when the `aid` field type is number
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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-unsubscr...@doris.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to