mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
Default codec if part is not stored on disk
This commit is contained in:
parent
0ff5e5412e
commit
d426751e26
@ -486,7 +486,10 @@ bool IMergeTreeDataPart::loadDefaultCompressionCodec()
|
||||
{
|
||||
/// In memory parts doesn't have any compression
|
||||
if (!isStoredOnDisk())
|
||||
{
|
||||
default_codec = CompressionCodecFactory::instance().get("NONE", {});
|
||||
return true;
|
||||
}
|
||||
|
||||
String path = getFullRelativePath() + DEFAULT_COMPRESSION_CODEC_FILE_NAME;
|
||||
if (!volume->getDisk()->exists(path))
|
||||
@ -522,9 +525,13 @@ bool IMergeTreeDataPart::loadDefaultCompressionCodec()
|
||||
|
||||
void IMergeTreeDataPart::detectAndSetDefaultCompressionCodec(size_t total_storage_size)
|
||||
{
|
||||
default_codec = storage.global_context.chooseCompressionCodec(
|
||||
getBytesOnDisk(),
|
||||
static_cast<double>(getBytesOnDisk()) / total_storage_size);
|
||||
/// In memory parts doesn't have any compression
|
||||
if (isStoredOnDisk())
|
||||
default_codec
|
||||
= storage.global_context.chooseCompressionCodec(getBytesOnDisk(),
|
||||
static_cast<double>(getBytesOnDisk()) / total_storage_size);
|
||||
else
|
||||
default_codec = CompressionCodecFactory::instance().get("NONE", {});
|
||||
}
|
||||
|
||||
void IMergeTreeDataPart::loadPartitionAndMinMaxIndex()
|
||||
|
Loading…
Reference in New Issue
Block a user