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

   ## Proposed changes
   
   Issue Number: close #xxx
   
   delete stmt predicate not suport some time at legacy in master 
branch(nereids work) and 2.0 branch
   like this:
   set experimental_enable_nereids_planner=false;
   
    CREATE TABLE `test_delete_predicate_function` (
     `ddate` DATETIME NULL COMMENT '周份字段',
     `dweek` VARCHAR(65533) NULL COMMENT '周序号'
   ) ENGINE=OLAP
   DUPLICATE KEY(`ddate`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`ddate`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1"
   );
   
   DELETE FROM test_delete_function WHERE   ddate  =  DATE_ADD(     DATE_ADD(   
    '20240401',       INTERVAL 0 - DAYOFWEEK('20240404') + 2 DAY     ),     
INTERVAL -7 DAY   );
   DELETE FROM test_delete_function WHERE   ddate 
=date_format(last_day('2024-04-01') - INTERVAL 1 MONTH + INTERVAL 1 
DAY,'yyyy-MM-dd');
   
   get error:ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, 
detailMessage = Right expr of binary predicate should be value, predicate: 
(`ddate` = CAST(date_format(last_day('2024-04-01 00:00:00') - INTERVAL 1 MONTH 
+ INTERVAL 1 DAY, '%Y-%m-%d') AS DATETIMEV2(0))), right expr type:DATETIMEV2(0)
   
   because legacy can't find match function signature, this pr add 
corresponding function
   
   
   ## 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