mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +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
|
/// In memory parts doesn't have any compression
|
||||||
if (!isStoredOnDisk())
|
if (!isStoredOnDisk())
|
||||||
|
{
|
||||||
|
default_codec = CompressionCodecFactory::instance().get("NONE", {});
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
String path = getFullRelativePath() + DEFAULT_COMPRESSION_CODEC_FILE_NAME;
|
String path = getFullRelativePath() + DEFAULT_COMPRESSION_CODEC_FILE_NAME;
|
||||||
if (!volume->getDisk()->exists(path))
|
if (!volume->getDisk()->exists(path))
|
||||||
@ -522,9 +525,13 @@ bool IMergeTreeDataPart::loadDefaultCompressionCodec()
|
|||||||
|
|
||||||
void IMergeTreeDataPart::detectAndSetDefaultCompressionCodec(size_t total_storage_size)
|
void IMergeTreeDataPart::detectAndSetDefaultCompressionCodec(size_t total_storage_size)
|
||||||
{
|
{
|
||||||
default_codec = storage.global_context.chooseCompressionCodec(
|
/// In memory parts doesn't have any compression
|
||||||
getBytesOnDisk(),
|
if (isStoredOnDisk())
|
||||||
static_cast<double>(getBytesOnDisk()) / total_storage_size);
|
default_codec
|
||||||
|
= storage.global_context.chooseCompressionCodec(getBytesOnDisk(),
|
||||||
|
static_cast<double>(getBytesOnDisk()) / total_storage_size);
|
||||||
|
else
|
||||||
|
default_codec = CompressionCodecFactory::instance().get("NONE", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void IMergeTreeDataPart::loadPartitionAndMinMaxIndex()
|
void IMergeTreeDataPart::loadPartitionAndMinMaxIndex()
|
||||||
|
Loading…
Reference in New Issue
Block a user