doris icon indicating copy to clipboard operation
doris copied to clipboard

[bug](legacy delete) legacy delete predicate support some time func

Open ryanzryu opened this issue 10 months ago • 3 comments

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] by explaining why you chose the solution you did and what alternatives you considered, etc...

ryanzryu avatar Apr 29 '24 12:04 ryanzryu

Thank you for your contribution to Apache Doris. Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website. See Doris Document.

doris-robot avatar Apr 29 '24 12:04 doris-robot

PR approved by at least one committer and no changes requested.

github-actions[bot] avatar May 09 '24 11:05 github-actions[bot]

PR approved by anyone and no changes requested.

github-actions[bot] avatar May 09 '24 11:05 github-actions[bot]