MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / copyFileFrom

Method copyFileFrom

src/Storages/MergeTree/DataPartStorageOnDiskFull.cpp:244–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void DataPartStorageOnDiskFull::copyFileFrom(const IDataPartStorage & source, const std::string & from, const std::string & to)
245{
246 const auto * source_on_disk = typeid_cast<const DataPartStorageOnDiskFull *>(&source);
247 if (!source_on_disk)
248 throw Exception(
249 ErrorCodes::LOGICAL_ERROR,
250 "Cannot create copy file from different storage. Expected DataPartStorageOnDiskFull, got {}",
251 typeid(source).name());
252
253 /// Copying files between different disks is
254 /// not supported in disk transactions.
255 source_on_disk->getDisk()->copyFile(
256 fs::path(source_on_disk->getRelativePath()) / from,
257 *volume->getDisk(),
258 fs::path(root_path) / part_dir / to,
259 getReadSettings());
260}
261
262void DataPartStorageOnDiskFull::createProjection(const std::string & name)
263{

Callers 1

prepareMethod · 0.80

Calls 6

getReadSettingsFunction · 0.85
getRelativePathMethod · 0.80
ExceptionClass · 0.50
nameMethod · 0.45
copyFileMethod · 0.45
getDiskMethod · 0.45

Tested by

no test coverage detected