mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
fix 02802_clickhouse_disks_s3_copy.sh
This commit is contained in:
parent
a74a89b766
commit
6d8954a055
@ -1,6 +1,7 @@
|
||||
#include <Interpreters/Context.h>
|
||||
#include "ICommand.h"
|
||||
|
||||
#include <IO/ReadBufferFromEmptyFile.h>
|
||||
#include <IO/ReadBufferFromFile.h>
|
||||
#include <IO/WriteBufferFromFile.h>
|
||||
#include <IO/copyData.h>
|
||||
@ -39,7 +40,11 @@ public:
|
||||
else
|
||||
{
|
||||
String relative_path_from = disk.getRelativeFromRoot(path_from.value());
|
||||
return disk.getDisk()->readFile(relative_path_from);
|
||||
auto res = disk.getDisk()->readFileIfExists(relative_path_from);
|
||||
if (res)
|
||||
return res;
|
||||
/// For backward compatibility.
|
||||
return std::make_unique<ReadBufferFromEmptyFile>();
|
||||
}
|
||||
}();
|
||||
|
||||
|
@ -57,7 +57,7 @@ bool MetadataStorageFromPlainObjectStorage::existsFile(const std::string & path)
|
||||
|
||||
/// The path does not correspond to a directory.
|
||||
auto directory = std::filesystem::path(object_key.serialize()) / "";
|
||||
return !object_storage->exists(StoredObject(directory));
|
||||
return !object_storage->existsOrHasAnyChild(directory);
|
||||
}
|
||||
|
||||
bool MetadataStorageFromPlainObjectStorage::existsDirectory(const std::string & path) const
|
||||
|
Loading…
Reference in New Issue
Block a user