datafuselabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.29k stars 701 forks source link

Feature: delete where conditions support deterministic #15376

Open wubx opened 2 weeks ago

wubx commented 2 weeks ago

Summary

error: APIError: ResponseError with 1002: Delete must have deterministic predicate

root@localhost:8000/default> create table t0429(c1 int, c2 date);

CREATE TABLE t0429(c1 int, c2 date)

root@localhost:8000/default> insert into t0429 values(1,'2024-04-29');

INSERT INTO
  t0429
VALUES
(1, '2024-04-29')

root@localhost:8000/default> delete from t0429 where c2=today();
error: APIError: ResponseError with 1002: Delete must have deterministic predicate
root@localhost:8000/default> select today();

SELECT
  today()

┌────────────┐
│   today()  │
│    Date    │
├────────────┤
│ 2024-04-29 │
└────────────┘
1 row read in 0.005 sec. Processed 1 row, 1 B (185.41 row/s, 185 B/s)