diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index 9adfcf7fef7..002211127a2 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -3608,6 +3608,9 @@ void MergeTreeData::checkPartDynamicColumns(MutableDataPartPtr & part, DataParts const auto & part_columns = part->getColumns(); for (const auto & part_column : part_columns) { + if (part_column.name == LightweightDeleteDescription::FILTER_COLUMN.name) + continue; + auto storage_column = columns.getPhysical(part_column.name); if (!storage_column.type->hasDynamicSubcolumns()) continue; diff --git a/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.reference b/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.reference new file mode 100644 index 00000000000..3ad5abd03ae --- /dev/null +++ b/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.reference @@ -0,0 +1 @@ +99 diff --git a/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.sql b/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.sql new file mode 100644 index 00000000000..cd29d0ac445 --- /dev/null +++ b/tests/queries/0_stateless/02352_lightweight_delete_and_object_column.sql @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t_obj SYNC; + +SET allow_experimental_object_type=1; + +CREATE TABLE t_obj(id Int32, name Object('json')) ENGINE = MergeTree() ORDER BY id; + +INSERT INTO t_obj select number, '{"a" : "' || toString(number) || '"}' FROM numbers(100); + +DELETE FROM t_obj WHERE id = 10; + +SELECT COUNT() FROM t_obj; + +DROP TABLE t_obj SYNC; +