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

   ### 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
   
   latest-master
   
   ### What's Wrong?
   
   1. create test table:
   ```
   CREATE TABLE `t3` (
     `k1` int(11) NULL,
     `a1` int(11) NULL
   ) ENGINE=OLAP
   DUPLICATE KEY(`k1`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k1`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2",
   "disable_auto_compaction" = "false"
   );
   ```
   
   2. insert test data
   `insert into t3 values(1,1),(2,2),(3,3),(4,null),(null,5);`
   
   3. wrong result with SQL:
   ```
   > select min(k1) from (select k1,a1 from t3 union select null,null) t;
   +-----------+
   | min(`k1`) |
   +-----------+
   |         0 |
   +-----------+
   ```
   
   4. correct min(k1) should be 1, such as:
   ```
   > select min(k1) from (select k1 from t3 union select null) t;
   +-----------+
   | min(`k1`) |
   +-----------+
   |         1 |
   +-----------+
   ```
   
   
   ### What You Expected?
   
   +-----------+
   | min(`k1`) |
   +-----------+
   |         1 |
   +-----------+
   
   ### How to Reproduce?
   
   _No response_
   
   ### 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: [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