mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 14:02:21 +00:00
Fix style
This commit is contained in:
parent
8477b81130
commit
bdc530dead
@ -7522,7 +7522,7 @@ bool MergeTreeData::canUsePolymorphicParts(const MergeTreeSettings & settings, S
|
||||
|
||||
AlterConversions MergeTreeData::getAlterConversionsForPart(const MergeTreeDataPartPtr part) const
|
||||
{
|
||||
MutationCommands commands = getFirstAlterMutationCommandsForPart(part);
|
||||
MutationCommands commands = getAlterMutationCommandsForPart(part);
|
||||
|
||||
AlterConversions result{};
|
||||
for (const auto & command : commands)
|
||||
|
@ -1303,7 +1303,7 @@ protected:
|
||||
/// Used to receive AlterConversions for part and apply them on fly. This
|
||||
/// method has different implementations for replicated and non replicated
|
||||
/// MergeTree because they store mutations in different way.
|
||||
virtual MutationCommands getFirstAlterMutationCommandsForPart(const DataPartPtr & part) const = 0;
|
||||
virtual MutationCommands getAlterMutationCommandsForPart(const DataPartPtr & part) const = 0;
|
||||
/// Moves part to specified space, used in ALTER ... MOVE ... queries
|
||||
bool movePartsToSpace(const DataPartsVector & parts, SpacePtr space);
|
||||
|
||||
|
@ -170,11 +170,7 @@ static void splitMutationCommands(
|
||||
if (alter_conversions.columnHasNewName(part_column.name))
|
||||
{
|
||||
auto new_column_name = alter_conversions.getColumnNewName(part_column.name);
|
||||
for_file_renames.push_back({
|
||||
.type = MutationCommand::Type::RENAME_COLUMN,
|
||||
.column_name = part_column.name,
|
||||
.rename_to = new_column_name,
|
||||
});
|
||||
for_file_renames.push_back({.type = MutationCommand::Type::RENAME_COLUMN, .column_name = part_column.name, .rename_to = new_column_name});
|
||||
|
||||
part_columns.rename(part_column.name, new_column_name);
|
||||
}
|
||||
|
@ -1752,7 +1752,7 @@ ReplicatedMergeTreeMergePredicate ReplicatedMergeTreeQueue::getMergePredicate(zk
|
||||
}
|
||||
|
||||
|
||||
MutationCommands ReplicatedMergeTreeQueue::getFirstAlterMutationCommandsForPart(const MergeTreeData::DataPartPtr & part) const
|
||||
MutationCommands ReplicatedMergeTreeQueue::getAlterMutationCommandsForPart(const MergeTreeData::DataPartPtr & part) const
|
||||
{
|
||||
std::lock_guard lock(state_mutex);
|
||||
auto in_partition = mutations_by_partition.find(part->info.partition_id);
|
||||
@ -1761,6 +1761,10 @@ MutationCommands ReplicatedMergeTreeQueue::getFirstAlterMutationCommandsForPart(
|
||||
|
||||
Int64 part_mutation_version = part->info.getMutationVersion();
|
||||
MutationCommands result;
|
||||
/// Here we return mutation commands for part which has bigger mutation version than part mutation version.
|
||||
/// Please note, we don't use getDataVersion(). It's because these alter commands are used for in-fly conversions
|
||||
/// of part's metadata. It mean that even if we have mutation with version X and part with data version X+10, but
|
||||
/// without mutation version part can still have wrong metadata and we have to apply this change on-fly if needed.
|
||||
for (auto [mutation_version, mutation_status] : in_partition->second)
|
||||
{
|
||||
if (mutation_version > part_mutation_version && mutation_status->entry->alter_version != -1)
|
||||
|
@ -393,10 +393,10 @@ public:
|
||||
|
||||
MutationCommands getMutationCommands(const MergeTreeData::DataPartPtr & part, Int64 desired_mutation_version) const;
|
||||
|
||||
/// Return mutation commands for part with smallest mutation version bigger
|
||||
/// than data part version. Used when we apply alter commands on fly,
|
||||
/// Return mutation commands for part which could be not applied to
|
||||
/// it according to part mutation version. Used when we apply alter commands on fly,
|
||||
/// without actual data modification on disk.
|
||||
MutationCommands getFirstAlterMutationCommandsForPart(const MergeTreeData::DataPartPtr & part) const;
|
||||
MutationCommands getAlterMutationCommandsForPart(const MergeTreeData::DataPartPtr & part) const;
|
||||
|
||||
/// Mark finished mutations as done. If the function needs to be called again at some later time
|
||||
/// (because some mutations are probably done but we are not sure yet), returns true.
|
||||
|
@ -2056,7 +2056,7 @@ void StorageMergeTree::attachRestoredParts(MutableDataPartsVector && parts)
|
||||
}
|
||||
|
||||
|
||||
MutationCommands StorageMergeTree::getFirstAlterMutationCommandsForPart(const DataPartPtr & part) const
|
||||
MutationCommands StorageMergeTree::getAlterMutationCommandsForPart(const DataPartPtr & part) const
|
||||
{
|
||||
std::lock_guard lock(currently_processing_in_background_mutex);
|
||||
|
||||
|
@ -265,7 +265,7 @@ private:
|
||||
|
||||
protected:
|
||||
|
||||
MutationCommands getFirstAlterMutationCommandsForPart(const DataPartPtr & part) const override;
|
||||
MutationCommands getAlterMutationCommandsForPart(const DataPartPtr & part) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -7892,9 +7892,9 @@ bool StorageReplicatedMergeTree::canUseAdaptiveGranularity() const
|
||||
}
|
||||
|
||||
|
||||
MutationCommands StorageReplicatedMergeTree::getFirstAlterMutationCommandsForPart(const DataPartPtr & part) const
|
||||
MutationCommands StorageReplicatedMergeTree::getAlterMutationCommandsForPart(const DataPartPtr & part) const
|
||||
{
|
||||
return queue.getFirstAlterMutationCommandsForPart(part);
|
||||
return queue.getAlterMutationCommandsForPart(part);
|
||||
}
|
||||
|
||||
|
||||
|
@ -830,7 +830,7 @@ private:
|
||||
void waitMutationToFinishOnReplicas(
|
||||
const Strings & replicas, const String & mutation_id) const;
|
||||
|
||||
MutationCommands getFirstAlterMutationCommandsForPart(const DataPartPtr & part) const override;
|
||||
MutationCommands getAlterMutationCommandsForPart(const DataPartPtr & part) const override;
|
||||
|
||||
void startBackgroundMovesIfNeeded() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user