mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Don't use switch
This commit is contained in:
parent
d8e5fb5195
commit
df34ab240d
@ -36,22 +36,24 @@ namespace
|
|||||||
|
|
||||||
orc::CompressionKind getORCCompression(FormatSettings::ORCCompression method)
|
orc::CompressionKind getORCCompression(FormatSettings::ORCCompression method)
|
||||||
{
|
{
|
||||||
switch (method)
|
if (method == FormatSettings::ORCCompression::NONE)
|
||||||
{
|
return orc::CompressionKind::CompressionKind_NONE;
|
||||||
case FormatSettings::ORCCompression::NONE:
|
|
||||||
return orc::CompressionKind::CompressionKind_NONE;
|
|
||||||
case FormatSettings::ORCCompression::SNAPPY:
|
|
||||||
#if USE_SNAPPY
|
#if USE_SNAPPY
|
||||||
return orc::CompressionKind::CompressionKind_SNAPPY;
|
if (method == FormatSettings::ORCCompression::SNAPPY)
|
||||||
|
return orc::CompressionKind::CompressionKind_SNAPPY;
|
||||||
#endif
|
#endif
|
||||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Snappy compression method is not supported");
|
|
||||||
case FormatSettings::ORCCompression::ZSTD:
|
if (method == FormatSettings::ORCCompression::ZSTD)
|
||||||
return orc::CompressionKind::CompressionKind_ZSTD;
|
return orc::CompressionKind::CompressionKind_ZSTD;
|
||||||
case FormatSettings::ORCCompression::LZ4:
|
|
||||||
return orc::CompressionKind::CompressionKind_LZ4;
|
if (method == FormatSettings::ORCCompression::LZ4)
|
||||||
case FormatSettings::ORCCompression::ZLIB:
|
return orc::CompressionKind::CompressionKind_LZ4;
|
||||||
return orc::CompressionKind::CompressionKind_ZLIB;
|
|
||||||
}
|
if (method == FormatSettings::ORCCompression::ZLIB)
|
||||||
|
return orc::CompressionKind::CompressionKind_ZLIB;
|
||||||
|
|
||||||
|
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Unsupported compression method");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user