Closed ernestasga closed 1 year ago
I have searched and tested. It's a bug of clickhouse. The JSON data type is an experimental feature.
https://github.com/ClickHouse/ClickHouse/issues/46575 https://stackoverflow.com/questions/76555036/clickhouse-how-to-update-json-field
create table test(id Int64, json JSON) engine MergeTree order by ();
insert into table test values (1, '{"a":"b"}');
-- no exception, but data not updated --
alter table test update json='{"a":"c"}' where 1;
-- Code: 341. DB::Exception: --
alter table test update json='{"a":"c"}' where 1 settings mutations_sync=1;
-- Code: 386. DB::Exception: --
alter table test update json='{"a":"c"}' where id=1;
Such a shame. Will need to look for an alternative solution. Closing the issue.
Describe the bug A database error is thrown during update of jsonfield.
To Reproduce Updating jsonfield of a model and save it.
Created a simple docker-compose project to demonstrate.
Check
app/event/views.py
for code.Expected behavior Should update the model successfully
Versions