mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Merge pull request #57083 from evillique/better-metadata-path
Better metadata path
This commit is contained in:
commit
644e671e81
@ -1046,9 +1046,17 @@ String DatabaseCatalog::getPathForDroppedMetadata(const StorageID & table_id) co
|
||||
|
||||
String DatabaseCatalog::getPathForMetadata(const StorageID & table_id) const
|
||||
{
|
||||
return getContext()->getPath() + "metadata/" +
|
||||
escapeForFileName(table_id.getDatabaseName()) + "/" +
|
||||
escapeForFileName(table_id.getTableName()) + ".sql";
|
||||
auto database = getDatabase(table_id.getDatabaseName());
|
||||
auto * database_ptr = dynamic_cast<DatabaseOnDisk *>(database.get());
|
||||
|
||||
if (!database_ptr)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Failed to get metadata path from database {}", table_id.getDatabaseName());
|
||||
|
||||
auto metadata_path = database_ptr->getMetadataPath();
|
||||
if (metadata_path.empty())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Empty metadata path in database {}", table_id.getDatabaseName());
|
||||
|
||||
return metadata_path + escapeForFileName(table_id.getTableName()) + ".sql";
|
||||
}
|
||||
|
||||
void DatabaseCatalog::enqueueDroppedTableCleanup(StorageID table_id, StoragePtr table, String dropped_metadata_path, bool ignore_delay)
|
||||
|
Loading…
Reference in New Issue
Block a user