File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -583,10 +583,26 @@ getColumnsForNewDataPart(
583583 }
584584 }
585585
586- // / We must use serialization info settings from source part, because data files of some
587- // / columns might be copied without actual serialization, so changes in serialization
586+ SerializationInfo::Settings settings;
587+ // / If mutations doesn't affect all columns we must use serialization info settings from source part,
588+ // / because data files of some columns might be copied without actual serialization, so changes in serialization
588589 // / settings will not be applied for them (for example, new serialization versions for data types).
589- SerializationInfo::Settings settings = serialization_infos.getSettings ();
590+ if (!affects_all_columns)
591+ {
592+ settings = serialization_infos.getSettings ();
593+ }
594+ // / Otherwise use fresh settings from storage.
595+ else
596+ {
597+ settings = SerializationInfo::Settings
598+ {
599+ (*source_part->storage .getSettings ())[MergeTreeSetting::ratio_of_defaults_for_sparse_serialization],
600+ false ,
601+ (*source_part->storage .getSettings ())[MergeTreeSetting::serialization_info_version],
602+ (*source_part->storage .getSettings ())[MergeTreeSetting::string_serialization_version],
603+ (*source_part->storage .getSettings ())[MergeTreeSetting::nullable_serialization_version],
604+ };
605+ }
590606
591607 SerializationInfoByName new_serialization_infos (settings);
592608 for (const auto & [name, old_info] : serialization_infos)
You can’t perform that action at this time.
0 commit comments