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

   ### 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.1
   
   ### What's Wrong?
   
   reproduce:
   ```
   CREATE TABLE `test_t` (
     `id` VARCHAR(36) NOT NULL COMMENT 'id',
     `created_time` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ''
   ) ENGINE=OLAP
   DUPLICATE KEY(`id`)
   COMMENT ''
   PARTITION BY RANGE(`created_time`)
   (PARTITION P_2024071713 VALUES [('2024-07-17 13:00:00'), ('2024-07-17 
14:00:00')),
   PARTITION P_2024071714 VALUES [('2024-07-17 14:00:00'), ('2024-07-17 
15:00:00')))
   DISTRIBUTED BY HASH(`id`) BUCKETS AUTO
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1"
   );
   CREATE MATERIALIZED VIEW test_mtmv
           BUILD IMMEDIATE REFRESH AUTO ON MANUAL
           partition by(date_trunc(created_time_minute, 'day'))
           DISTRIBUTED BY RANDOM BUCKETS 3
           PROPERTIES ('replication_num' = '1') 
           AS 
   select  id 
           ,date_trunc(created_time, 'minute') as created_time_minute
           ,min(created_time) as start_time
           ,if(count(id) > 0, 1, 0) as status
           from test_t 
           group by id, date_trunc(created_time, 'minute');
   ```
   An error occurs:
   ```
   ERROR 1105 (HY000): errCode = 2, detailMessage = Unable to find a suitable 
base table for partitioning, the fail reason is can't not find valid partition 
track column, because column to check use invalid implicit expression, invalid 
expression is min(created_time#12)
   ```
   
   ### What You Expected?
   
   `test_t` should be selected as base table.
   `date_trunc(created_time, 'minute')` should pass the check and 
`min(created_time)` should be ignore.
   
   ### How to Reproduce?
   
    Refer to the description above.
   
   ### 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-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