From a3665005d163747f1cdecbd16ccbff58960fdf64 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: Sat, 12 Aug 2023 01:59:00 +0000 Subject: [PATCH] Fix --- src/Compression/CompressionCodecGCD.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Compression/CompressionCodecGCD.cpp b/src/Compression/CompressionCodecGCD.cpp index d12d3400b1a..bc4ef818862 100644 --- a/src/Compression/CompressionCodecGCD.cpp +++ b/src/Compression/CompressionCodecGCD.cpp @@ -77,6 +77,7 @@ namespace ErrorCodes extern const int CANNOT_DECOMPRESS; extern const int ILLEGAL_CODEC_PARAMETER; extern const int BAD_ARGUMENTS; + extern const int ILLEGAL_SYNTAX_FOR_CODEC_TYPE; } UInt32 CompressionCodecGCD::getMaxCompressedDataSize(UInt32 uncompressed_size) const @@ -356,18 +357,15 @@ void registerCodecGCD(CompressionCodecFactory & factory) UInt8 method_code = static_cast(CompressionMethodByte::GCD); auto codec_builder = [&](const ASTPtr & arguments, const IDataType * column_type) -> CompressionCodecPtr { - - if (arguments && !arguments->children.empty()) - throw Exception(ErrorCodes::ILLEGAL_CODEC_PARAMETER, "GCD codec must have 0 parameters, given {}", arguments->children.size()); - /// Default bytes size is 1. Int8 gcd_bytes_size = 1; - if (column_type) { gcd_bytes_size = getGCDBytesSize(column_type); } + if (arguments && arguments->children.size() > 1) + throw Exception(ErrorCodes::ILLEGAL_SYNTAX_FOR_CODEC_TYPE, "GCD codec must have 1 parameter, given {}", arguments->children.size()); return std::make_shared(gcd_bytes_size); }; factory.registerCompressionCodecWithType("GCD", method_code, codec_builder);