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

   ## Proposed changes
   
   ## create table
   ```sql
   create table if not exists sub_query_correlated_subquery1
           (k1 bigint, k2 bigint)
           duplicate key(k1)
           distributed by hash(k2) buckets 1
           properties('replication_num' = '1') ;
   
   create table if not exists sub_query_correlated_subquery3
           (k1 int, k2 varchar(128), k3 bigint, v1 bigint, v2 bigint)
           distributed by hash(k2) buckets 1
           properties('replication_num' = '1');
   
   ```
   
   ## insert data
   ```sql
   insert into sub_query_correlated_subquery1 values (1,null),(null,1),(1,2), 
(null,2),(1,3), (2,4), (2,5), (3,3), (3,4), (20,2), (22,3), (24,4),(null,null);
   insert into sub_query_correlated_subquery3 values (1,"abc",2,3,4), 
(1,"abcd",3,3,4), (2,"xyz",2,4,2),(2,"uvw",3,4,2), (2,"uvw",3,4,2), 
(3,"abc",4,5,3), (3,"abc",4,5,3), (null,null,null,null,null); 
   
   ```
   ## query
   ```sql
   select * from sub_query_correlated_subquery1 where 
sub_query_correlated_subquery1.k1 not in (select 
sub_query_correlated_subquery3.k3 from sub_query_correlated_subquery3 )  or k1 
< 10 order by k1, k2;
   ```
   ## result
   ```
   Empty set (
   ```
   ## Expect result
   ```
   k1   k2
   1    null
   1    2
   1    3
   2    4
   2    5
   3    3
   3    4
   ```
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


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