You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/10/24 14:07:43 UTC

[GitHub] [doris] cambyzju opened a new issue, #13606: [Bug] inner join with functions return wrong result

cambyzju opened a new issue, #13606:
URL: https://github.com/apache/doris/issues/13606

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   latest-master
   
   ### What's Wrong?
   
   return correct result:
   `select t1.k1, array_min(t2.a1) from t1 join t2 where array_max(t1.a1) = array_max(t2.a1);`
   
   return wrong result:
   `select array_min(t2.a1) from t1 join t2 where array_max(t1.a1) = array_max(t2.a1);`
   
   
   
   ### What You Expected?
   
   fix
   
   ### How to Reproduce?
   
   1. create same schema table t1 and t2:
   ```
   CREATE TABLE `t1` (
     `k1` int(11) NULL,
     `a1` array<int(11)> NULL
   ) ENGINE=OLAP
   DUPLICATE KEY(`k1`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k1`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1"
   );
   ```
   
   2. add test data:
   ```
   insert into t1 values(1, [1,2,3]),(3,[3,2,1]),(3,[3,2,1,NULL]),(2,[3,4,5]);
   insert into t2 values(1,[2]),(2,[3]);
   ```
   
   3. inner join with functions:
   Following SQL return 3 rows:
   `select t1.k1, array_min(t2.a1) from t1 join t2 where array_max(t1.a1) = array_max(t2.a1);`
   ```
   +------+----------------------+
   | k1   | array_min(`t2`.`a1`) |
   +------+----------------------+
   |    3 |                    3 |
   |    3 |                    3 |
   |    1 |                    3 |
   +------+----------------------+
   3 rows in set (0.043 sec)
   ```
   
   But this SQL return 0 rows, the correct result should also include 3 rows like the above SQL:
   `select array_min(t2.a1) from t1 join t2 where array_max(t1.a1) = array_max(t2.a1);`
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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-unsubscribe@doris.apache.org.apache.org

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


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


[GitHub] [doris] yangzhg closed issue #13606: [Bug] inner join with functions return wrong result

Posted by GitBox <gi...@apache.org>.
yangzhg closed issue #13606: [Bug] inner join with functions return wrong result
URL: https://github.com/apache/doris/issues/13606


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

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


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