mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Merge
This commit is contained in:
parent
3efa9e91c9
commit
8f394dd852
@ -341,8 +341,9 @@ public:
|
||||
|
||||
bool hasColumnFiles(const String & column) const
|
||||
{
|
||||
return Poco::File(storage.full_path + name + "/" + column + ".bin").exists() &&
|
||||
Poco::File(storage.full_path + name + "/" + column + ".mrk").exists();
|
||||
String escaped_column = escapeForFileName(column);
|
||||
return Poco::File(storage.full_path + name + "/" + escaped_column + ".bin").exists() &&
|
||||
Poco::File(storage.full_path + name + "/" + escaped_column + ".mrk").exists();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -421,6 +421,12 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart(DataPart
|
||||
AlterDataPartTransactionPtr transaction(new AlterDataPartTransaction(part));
|
||||
createConvertExpression(part, *columns, new_columns, expression, transaction->rename_map); // TODO: part->columns
|
||||
|
||||
if (transaction->rename_map.empty())
|
||||
{
|
||||
transaction->data_part = nullptr;
|
||||
return transaction;
|
||||
}
|
||||
|
||||
DataPart::Checksums add_checksums;
|
||||
|
||||
/// Применим выражение и запишем результат во временные файлы.
|
||||
@ -441,7 +447,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart(DataPart
|
||||
add_checksums = out.writeSuffixAndGetChecksums();
|
||||
}
|
||||
|
||||
/// Обновим контрольные суммы. Заполним в транзакции список переименований файлов.
|
||||
/// Обновим контрольные суммы.
|
||||
DataPart::Checksums new_checksums = part->checksums;
|
||||
for (auto it : transaction->rename_map)
|
||||
{
|
||||
@ -463,9 +469,6 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart(DataPart
|
||||
transaction->rename_map["checksums.txt.tmp"] = "checksums.txt";
|
||||
}
|
||||
|
||||
if (transaction->rename_map.empty())
|
||||
transaction->data_part = nullptr;
|
||||
|
||||
return transaction;
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ private:
|
||||
}
|
||||
|
||||
if (zookeeper.exists(path + "/" + *(it - 1), nullptr, event))
|
||||
event->tryWait(60 * 1000);
|
||||
event->wait();
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user