Skip to content

Commit d63f45b

Browse files
authored
Merge pull request ClickHouse#89857 from ClickHouse/backport/25.8/89819
Backport ClickHouse#89819 to 25.8: Fix reading paths and paths subcolumns from advanced shared data serialization
2 parents 312508b + a5ad8e9 commit d63f45b

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/DataTypes/Serializations/SerializationObjectSharedData.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,9 @@ std::shared_ptr<SerializationObjectSharedData::PathsDataGranules> SerializationO
962962
throw Exception(ErrorCodes::LOGICAL_ERROR, "Info for path {} is not deserialized", requested_path);
963963

964964
const auto & path_info = path_info_it->second;
965+
/// Reset callbacks that might be different for different paths.
966+
deserialization_settings.seek_stream_to_current_mark_callback = {};
967+
deserialization_settings.getter = {};
965968

966969
/// If we have only subcolumns requested for this path, read all subcolumns.
967970
auto paths_subcolumns_it = structure_state.requested_paths_subcolumns.find(requested_path);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
['{"arr1":9}'] {}
2+
['{"arr1":9}'] {}
3+
[] {"b":[{"c":42}]}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SET optimize_if_transform_strings_to_enum=0;
2+
3+
DROP TABLE IF EXISTS t0;
4+
CREATE TABLE t0 (c0 JSON(max_dynamic_paths = 0)) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 1, object_serialization_version = 'v3', object_shared_data_serialization_version_for_zero_level_parts = 'advanced', object_shared_data_buckets_for_wide_part = 1, index_granularity=2;
5+
6+
INSERT INTO t0 SELECT multiIf(
7+
number < 2,
8+
'{"arr" : [{"arr1" : 9}]}',
9+
'{"a" : {"b" : [{"c" : 42}]}}'
10+
) FROM numbers(3);
11+
12+
SELECT c0.arr.:`Array(JSON)`, c0.^a FROM t0;
13+
DROP TABLE t0;
14+

0 commit comments

Comments
 (0)