From ef857f3646e9c6839a8236b74b09269de1cd8be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=9D=D0=B0=D0=BC?= Date: Wed, 9 Aug 2023 21:32:37 +0000 Subject: [PATCH] Fix --- src/Compression/CompressionCodecGCD.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Compression/CompressionCodecGCD.cpp b/src/Compression/CompressionCodecGCD.cpp index b3d8c359c45..668123e2106 100644 --- a/src/Compression/CompressionCodecGCD.cpp +++ b/src/Compression/CompressionCodecGCD.cpp @@ -355,28 +355,12 @@ Int8 getGCDBytesSize(const IDataType * column_type) void registerCodecGCD(CompressionCodecFactory & factory) { UInt8 method_code = static_cast(CompressionMethodByte::GCD); - auto codec_builder = [&](const ASTPtr & arguments, const IDataType * column_type) -> CompressionCodecPtr + auto codec_builder = [&](const ASTPtr &, const IDataType * column_type) -> CompressionCodecPtr { /// Default bytes size is 1. Int8 gcd_bytes_size = 1; - if (arguments && !arguments->children.empty()) - { - if (arguments->children.size() > 1) - throw Exception(ErrorCodes::ILLEGAL_SYNTAX_FOR_CODEC_TYPE, "GCD codec must have 1 parameter, given {}", arguments->children.size()); - - const auto children = arguments->children; - const auto * literal = children[0]->as(); - if (!literal || (literal->value.getType() != Field::Types::Which::Int64 && literal->value.getType() != Field::Types::Which::UInt64)) - throw Exception(ErrorCodes::ILLEGAL_CODEC_PARAMETER, "GCD codec argument must be integer"); - - Int64 user_bytes_size = literal->value.safeGet(); - if (user_bytes_size != 1 && user_bytes_size != 2 && user_bytes_size != 4 && user_bytes_size != 8 && user_bytes_size != 16 && user_bytes_size != 32 && - user_bytes_size != -1 && user_bytes_size != -2 && user_bytes_size != -4 && user_bytes_size != -8 && user_bytes_size != -16 && user_bytes_size != -32) - throw Exception(ErrorCodes::ILLEGAL_CODEC_PARAMETER, "GCD value for GCD codec can be +-1, +-2, +-4, +-8, +-16 or +-32, given {}", user_bytes_size); - gcd_bytes_size = static_cast(user_bytes_size); - } - else if (column_type) + if (column_type) { gcd_bytes_size = getGCDBytesSize(column_type); }