mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix compression level detection when network_compression_method in lowercase (#4706)
This commit is contained in:
parent
451bfaf51b
commit
78e0b1af5e
@ -767,7 +767,7 @@ void TCPHandler::initBlockOutput(const Block & block)
|
||||
{
|
||||
if (!state.maybe_compressed_out)
|
||||
{
|
||||
std::string method = query_context->getSettingsRef().network_compression_method;
|
||||
std::string method = Poco::toUpper(query_context->getSettingsRef().network_compression_method.toString());
|
||||
std::optional<int> level;
|
||||
if (method == "ZSTD")
|
||||
level = query_context->getSettingsRef().network_zstd_compression_level;
|
||||
|
@ -357,7 +357,7 @@ void Connection::sendQuery(
|
||||
if (settings)
|
||||
{
|
||||
std::optional<int> level;
|
||||
std::string method = settings->network_compression_method;
|
||||
std::string method = Poco::toUpper(settings->network_compression_method.toString());
|
||||
|
||||
/// Bad custom logic
|
||||
if (method == "ZSTD")
|
||||
|
@ -14,4 +14,5 @@ CREATE TABLE test.compression_codec_multiple_more_types ( id Decimal(38, 13) COD
|
||||
7.1000000000000 xxxxxxxxxxxx [127] ['Henry']
|
||||
!
|
||||
222
|
||||
!ZSTD
|
||||
CREATE TABLE test.test_default_delta ( id UInt64 CODEC(Delta(8)), data String CODEC(Delta(1)), somedate Date CODEC(Delta(2)), somenum Float64 CODEC(Delta(8)), somestr FixedString(3) CODEC(Delta(1)), othernum Int64 CODEC(Delta(8)), yetothernum Float32 CODEC(Delta(4)), `ddd.age` Array(UInt8) CODEC(Delta(1)), `ddd.Name` Array(String) CODEC(Delta(1)), `ddd.OName` Array(String) CODEC(Delta(1)), `ddd.BName` Array(String) CODEC(Delta(1))) ENGINE = MergeTree() ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
|
@ -116,6 +116,14 @@ INSERT INTO test.compression_codec_multiple_with_key SELECT toDate('2018-10-12')
|
||||
|
||||
SELECT COUNT(DISTINCT data) FROM test.compression_codec_multiple_with_key WHERE id < 222;
|
||||
|
||||
-- method in lowercase
|
||||
SET network_compression_method = 'ZSTD';
|
||||
SET network_zstd_compression_level = 7;
|
||||
|
||||
INSERT INTO test.compression_codec_multiple_with_key VALUES(toDate('2018-10-13'), 100001, 'hello1'), (toDate('2018-10-14'), 100003, 'world1'), (toDate('2018-10-15'), 2222, '!ZSTD');
|
||||
|
||||
SELECT data FROM test.compression_codec_multiple_with_key WHERE id = 2222;
|
||||
|
||||
DROP TABLE IF EXISTS test.compression_codec_multiple_with_key;
|
||||
|
||||
DROP TABLE IF EXISTS test.test_default_delta;
|
||||
|
Loading…
Reference in New Issue
Block a user