"""Port of ``packages/core/src/codec-rules.test.ts`` (#465). Each codec on a column of the type, with the issue chkit reports, or None when ClickHouse 26.3 accepts it. Both ports assert the same table. """ from __future__ import annotations from typing import Any import pytest from chkit import table from chkit.core.validate import validate_definitions CASES: list[tuple[str, Any, tuple[str, str] | None]] = [ # Unparsed Enum types skip leaf checks; the server validates type syntax. ("Enum()", {"kind": "T64"}, None), ("Enum('a' = 1 2)", {"kind": "Gorilla"}, None), ("UInt64", [{"kind": "T64"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", [{"kind": "DoubleDelta"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", [{"kind": "Delta"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", [{"kind": "GCD"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", [{"kind": "NONE"}, {"kind": "LZ4"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", {"kind": "raw", "expression": "T64, NONE"}, ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("Float64", [{"kind": "Gorilla"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("Float64", [{"kind": "FPC"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("Float64", [{"kind": "ALP"}, {"kind": "NONE"}], ("codec_none_combined", "combines NONE with other codecs; NONE must be the only codec")), ("UInt64", [{"kind": "LZ4"}, {"kind": "ZSTD"}], ("codec_chain_multiple_general", "codec chain has more than one general codec (LZ4, ZSTD); a chain takes at most one of LZ4, LZ4HC, ZSTD, Default")), ("UInt64", [{"kind": "ZSTD"}, {"kind": "T64"}], ("codec_chain_must_end_with_general", "codec chain puts T64 after the general codec ZSTD; only encryption codecs may follow a general codec (LZ4, LZ4HC, ZSTD, Default)")), ("UInt64", [{"kind": "ZSTD"}, {"kind": "DoubleDelta"}], ("codec_chain_must_end_with_general", "codec chain puts DoubleDelta after the general codec ZSTD; only encryption codecs may follow a general codec (LZ4, LZ4HC, ZSTD, Default)")), ("UInt64", [{"kind": "Default"}, {"kind": "ZSTD"}], ("codec_chain_multiple_general", "codec chain has more than one general codec (Default, ZSTD); a chain takes at most one of LZ4, LZ4HC, ZSTD, Default")), ("UInt64", {"kind": "Delta"}, ("codec_chain_no_compression", "codec chain only transforms the data (Delta) and compresses nothing; add a codec such as LZ4, ZSTD or T64")), ("UInt64", {"kind": "GCD"}, ("codec_chain_no_compression", "codec chain only transforms the data (GCD) and compresses nothing; add a codec such as LZ4, ZSTD or T64")), ("UInt64", [{"kind": "Delta"}, {"kind": "GCD"}], ("codec_chain_no_compression", "codec chain only transforms the data (Delta, GCD) and compresses nothing; add a codec such as LZ4, ZSTD or T64")), ("Float64", [{"kind": "Delta"}, {"kind": "Gorilla"}, {"kind": "ZSTD"}], ("codec_chain_float_order", "codec chain puts Gorilla after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta")), ("Float64", [{"kind": "DoubleDelta"}, {"kind": "Gorilla"}], ("codec_chain_float_order", "codec chain puts Gorilla after DoubleDelta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta")), ("Float64", [{"kind": "Delta"}, {"kind": "ALP"}], ("codec_chain_float_order", "codec chain puts ALP after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta")), ("Float64", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type Float64")), ("String", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type String")), ("Decimal(38,4)", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type Decimal(38,4)")), ("Nullable(String)", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type String in Nullable(String)")), ('UInt64', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt64: no float leaf reachable through Nullable, Array or Tuple')), ('Decimal(18,4)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Decimal(18,4): no float leaf reachable through Nullable, Array or Tuple')), ('Date', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Date: no float leaf reachable through Nullable, Array or Tuple')), ("UInt64", {"kind": "FPC"}, ("codec_type_unsupported", "codec FPC does not support type UInt64")), ("UInt64", {"kind": "ALP"}, ("codec_type_unsupported", "codec ALP does not support type UInt64")), ("BFloat16", {"kind": "FPC"}, ("codec_type_unsupported", "codec FPC does not support type BFloat16")), ("BFloat16", {"kind": "ALP"}, ("codec_type_unsupported", "codec ALP does not support type BFloat16")), ("Decimal(18,4)", {"kind": "FPC"}, ("codec_type_unsupported", "codec FPC does not support type Decimal(18,4)")), ("Decimal(18,4)", {"kind": "ALP"}, ("codec_type_unsupported", "codec ALP does not support type Decimal(18,4)")), ("Float64", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type Float64")), ("UUID", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type UUID")), ("Enum8('a' = 1)", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type Enum8('a' = 1)")), ("String", [{"kind": "Delta"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec Delta does not support type String")), ("String", {"kind": "DoubleDelta"}, ("codec_type_unsupported", "codec DoubleDelta does not support type String")), ("LowCardinality(String)", [{"kind": "Delta"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec Delta does not support type String in LowCardinality(String)")), ("LowCardinality(String)", {"kind": "DoubleDelta"}, ("codec_type_unsupported", "codec DoubleDelta does not support type String in LowCardinality(String)")), ("UInt128", [{"kind": "Delta"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec Delta does not support type UInt128")), ("UInt128", {"kind": "DoubleDelta"}, ("codec_type_unsupported", "codec DoubleDelta does not support type UInt128")), ("FixedString(16)", [{"kind": "Delta"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec Delta does not support type FixedString(16)")), ("FixedString(16)", {"kind": "DoubleDelta"}, ("codec_type_unsupported", "codec DoubleDelta does not support type FixedString(16)")), ("String", {"kind": "ZSTD", "level": 23}, ("codec_parameter_invalid", "codec ZSTD level must be at most 22")), ("UInt64", {"kind": "LZ4HC", "level": 36028797018963968}, ("codec_parameter_invalid", "codec LZ4HC level must be between -9007199254740991 and 9007199254740991")), ("UInt64", {"kind": "ZSTD", "level": -9007199254740992}, ("codec_parameter_invalid", "codec ZSTD level must be between -9007199254740991 and 9007199254740991")), ("UInt64", {"kind": "ZSTD", "level": -9007199254740991}, None), ("Float64", {"kind": "FPC", "level": 0}, ("codec_parameter_invalid", "codec FPC level must be an integer between 1 and 28")), ("Float64", {"kind": "FPC", "level": 29}, ("codec_parameter_invalid", "codec FPC level must be an integer between 1 and 28")), ("UInt64", {"kind": "Delta", "size": 3}, ("codec_parameter_invalid", "codec Delta size must be 1, 2, 4 or 8")), ("String", {"kind": "ZSTD", "level": 1.5}, ("codec_parameter_invalid", "codec ZSTD level must be an integer")), ("String", {"kind": "Zstd"}, ("codec_unknown", "has an unknown codec kind \"Zstd\"; codec kinds are case-sensitive: NONE, LZ4, LZ4HC, ZSTD, Default, Delta, DoubleDelta, Gorilla, GCD, T64, FPC, ALP, raw")), ("String", {"general": "ZSTD"}, ("codec_unknown", "has a codec without a kind; use one of NONE, LZ4, LZ4HC, ZSTD, Default, Delta, DoubleDelta, Gorilla, GCD, T64, FPC, ALP, raw")), ("String", [], ("codec_chain_empty", "codec chain is empty; provide at least one codec or omit the field")), ("UInt64", {"kind": "T64"}, None), ("UInt64", [{"kind": "T64"}, {"kind": "LZ4"}], None), ("UInt64", [{"kind": "T64"}, {"kind": "ZSTD", "level": 3}], None), ("UInt64", [{"kind": "Delta"}, {"kind": "T64"}, {"kind": "LZ4"}], None), ("UInt64", [{"kind": "Delta"}, {"kind": "T64"}], None), ("UInt64", [{"kind": "GCD"}, {"kind": "T64"}], None), ("UInt64", [{"kind": "T64"}, {"kind": "T64"}], None), ("UInt64", {"kind": "DoubleDelta"}, None), ("UInt64", [{"kind": "DoubleDelta"}, {"kind": "T64"}], None), ("Float64", {"kind": "Gorilla"}, None), ("Float64", [{"kind": "Gorilla"}, {"kind": "FPC"}], None), ("Float64", {"kind": "FPC"}, None), ("Float64", {"kind": "FPC", "level": 12}, None), ("Float64", {"kind": "ALP"}, None), ("Float64", [{"kind": "ALP"}, {"kind": "ZSTD"}], None), ("Float64", [{"kind": "ALP"}, {"kind": "LZ4"}], None), ("Float64", [{"kind": "Gorilla"}, {"kind": "Delta"}, {"kind": "LZ4"}], None), ("Float64", [{"kind": "Gorilla"}, {"kind": "ALP"}], ("codec_chain_float_order", "codec chain puts ALP after Gorilla; ClickHouse creates the column but rejects every insert, so ALP cannot follow Gorilla, FPC or ALP")), ("Float64", [{"kind": "FPC"}, {"kind": "ALP"}], ("codec_chain_float_order", "codec chain puts ALP after FPC; ClickHouse creates the column but rejects every insert, so ALP cannot follow Gorilla, FPC or ALP")), ("Float64", [{"kind": "ALP"}, {"kind": "ALP"}], ("codec_chain_float_order", "codec chain puts ALP after ALP; ClickHouse creates the column but rejects every insert, so ALP cannot follow Gorilla, FPC or ALP")), ("Float64", [{"kind": "Delta"}, {"kind": "FPC"}], ("codec_chain_float_order", "codec chain puts FPC after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta")), ("String", {"kind": "raw", "expression": "ZSTD, AES_128_GCM_SIV"}, None), ("String", {"kind": "raw", "expression": "AES_128_GCM_SIV, ZSTD"}, ("codec_chain_encryption_not_last", "codec chain puts ZSTD after the encryption codec AES_128_GCM_SIV; encryption codecs must come last")), ("String", {"kind": "raw", "expression": "AES_128_GCM_SIV, AES_256_GCM_SIV"}, None), ("String", {"kind": "raw", "expression": "ZSTD(23)"}, ("codec_parameter_invalid", "codec ZSTD level must be at most 22")), ("String", {"kind": "raw", "expression": "zstd"}, ("codec_unknown", "codec raw \"zstd\" names an unknown codec; codec names are case-sensitive: ZSTD")), ("String", {"kind": "raw", "expression": ""}, ("codec_parameter_invalid", "codec raw expression must be a non-empty string")), ("String", {"kind": "ZSTD", "level": 3, "windowLog": 9}, ("codec_parameter_invalid", "codec ZSTD windowLog must be 0 or an integer between 10 and 31")), ("String", {"kind": "ZSTD", "level": 3, "windowLog": 24}, None), ("String", {"kind": "LZ4", "level": 3}, ("codec_parameter_invalid", "codec LZ4 has an unknown field \"level\"")), ("String", {"kind": "LZ4HC", "level": 1.5}, ("codec_parameter_invalid", "codec LZ4HC level must be an integer")), ("String", {"kind": "ZSTD", "level": -1}, None), ("String", {"kind": "Default"}, None), ("UInt64", {"kind": "raw", "expression": "Delta(3), LZ4"}, ("codec_parameter_invalid", "codec raw \"Delta(3)\" has invalid arguments for Delta")), ("UInt64", {"kind": "raw", "expression": "T64('BIT')"}, ("codec_parameter_invalid", "codec raw \"T64('BIT')\" has invalid arguments for T64")), ("UInt64", {"kind": "raw", "expression": "Delta, Default"}, None), ("UInt64", {"kind": "T64", "mode": "bit"}, None), ("UInt64", {"kind": "T64", "mode": "BIT"}, ("codec_parameter_invalid", "codec T64 mode must be 'byte' or 'bit'")), ("UInt64", [{"kind": "Delta"}, {"kind": "raw", "expression": "AES_128_GCM_SIV"}], ("codec_chain_no_compression", "codec chain only transforms the data (Delta) and compresses nothing; add a codec such as LZ4, ZSTD or T64")), ("UInt64", [{"kind": "Delta"}, {"kind": "Default"}], None), ("Float64", {"kind": "FPC", "level": 12, "floatSize": 6}, ("codec_parameter_invalid", "codec FPC floatSize must be 4 or 8")), ("Float64", {"kind": "Gorilla", "size": 8}, None), ("Float64", {"kind": "DoubleDelta", "size": 16}, ("codec_parameter_invalid", "codec DoubleDelta size must be 1, 2, 4 or 8")), ("Map(String, UInt64)", [{"kind": "Delta"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec Delta does not support type String in Map(String, UInt64)")), ("Map(String, UInt64)", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type String in Map(String, UInt64)")), ("Map(String, UInt64)", {"kind": "Gorilla"}, ("codec_type_unsupported", "codec Gorilla does not support type String in Map(String, UInt64)")), ("Map(String, UInt64)", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type String in Map(String, UInt64)")), ("Tuple(a UInt8, b UInt64)", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Tuple(a UInt8, b UInt64)", [{"kind": "GCD"}, {"kind": "LZ4"}], None), ('Tuple(a UInt8, b UInt64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(a UInt8, b UInt64): no float leaf reachable through Nullable, Array or Tuple')), ("Tuple(a UInt8, b UInt64)", {"kind": "T64"}, None), ("Array(Nullable(UInt16))", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Array(Nullable(UInt16))", [{"kind": "GCD"}, {"kind": "LZ4"}], None), ('Array(Nullable(UInt16))', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Array(Nullable(UInt16)): no float leaf reachable through Nullable, Array or Tuple')), ("Array(Nullable(UInt16))", {"kind": "T64"}, None), ("Map(UInt64, Float64)", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Map(UInt64, Float64)", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type Float64 in Map(UInt64, Float64)")), ('Map(UInt64, Float64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ("Map(UInt64, Float64)", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type Float64 in Map(UInt64, Float64)")), ("JSON", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("JSON", [{"kind": "GCD"}, {"kind": "LZ4"}], None), ("JSON", {"kind": "Gorilla"}, ("codec_type_unsupported", "codec Gorilla does not support type JSON: no float leaf reachable through Nullable, Array or Tuple")), ("JSON", {"kind": "T64"}, None), ("Time", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Time", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type Time")), ('Time', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Time: no float leaf reachable through Nullable, Array or Tuple')), ("Time", {"kind": "T64"}, None), ("IPv4", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("IPv4", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type IPv4")), ('IPv4', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type IPv4: no float leaf reachable through Nullable, Array or Tuple')), ("IPv4", {"kind": "T64"}, None), ("Bool", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Bool", [{"kind": "GCD"}, {"kind": "LZ4"}], None), ('Bool', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Bool: no float leaf reachable through Nullable, Array or Tuple')), ("Bool", {"kind": "T64"}, None), ("Enum('a' = 1)", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("Enum('a' = 1)", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type Enum('a' = 1)")), ("Enum('a' = 1)", {'kind': 'Gorilla'}, ('codec_type_unsupported', "codec Gorilla does not support type Enum('a' = 1): no float leaf reachable through Nullable, Array or Tuple")), ("Enum('a' = 1)", {"kind": "T64"}, None), ("FixedString(4)", [{"kind": "Delta"}, {"kind": "LZ4"}], None), ("FixedString(4)", [{"kind": "GCD"}, {"kind": "LZ4"}], ("codec_type_unsupported", "codec GCD does not support type FixedString(4)")), ('FixedString(4)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type FixedString(4): no float leaf reachable through Nullable, Array or Tuple')), ("FixedString(4)", {"kind": "T64"}, ("codec_type_unsupported", "codec T64 does not support type FixedString(4)")), ("UInt64", {"kind": "raw", "expression": "ZSTD(0x1)"}, None), ("UInt64", {"kind": "raw", "expression": "ZSTD(1_0)"}, None), ("UInt64", {"kind": "raw", "expression": "ZSTD(1.0)"}, ("codec_parameter_invalid", "codec raw \"ZSTD(1.0)\" has invalid arguments for ZSTD")), ("UInt64", {"kind": "raw", "expression": "T64( 'bit' )"}, None), ("UInt64", {"kind": "raw", "expression": "T64('b it')"}, ("codec_parameter_invalid", "codec raw \"T64('b it')\" has invalid arguments for T64")), ("UInt64", {"kind": "raw", "expression": "LZ4HC(-1)"}, None), ("UInt64", {"kind": "raw", "expression": "LZ4HC(2147483648)"}, None), ("UInt64", {"kind": "LZ4HC", "level": 4294967297}, None), ("UInt64", {"kind": "raw", "expression": "ZSTD(-9007199254740993)"}, ("codec_parameter_invalid", "codec raw \"ZSTD(-9007199254740993)\" has invalid arguments for ZSTD")), ("Float64", {"kind": "Gorilla", "size": True}, ("codec_parameter_invalid", "codec Gorilla size must be 1, 2, 4 or 8")), # ClickHouse 26.3 server-matrix findings 1, 2, 3, 5 and 8. ('SimpleAggregateFunction(sum, UInt64)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('SimpleAggregateFunction(sum, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('SimpleAggregateFunction(max, DateTime)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('SimpleAggregateFunction(max, DateTime)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('SimpleAggregateFunction(max, Float64)', {'kind': 'Gorilla'}, None), ('SimpleAggregateFunction(max, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('SimpleAggregateFunction(max, Float32)', {'kind': 'FPC'}, None), ('SimpleAggregateFunction(max, Float32)', {'kind': 'raw', 'expression': 'FPC'}, None), ('SimpleAggregateFunction(sum, UInt64)', {'kind': 'T64'}, None), ('SimpleAggregateFunction(sum, UInt64)', {'kind': 'raw', 'expression': 'T64'}, None), ('SimpleAggregateFunction(sum, UInt64)', {'kind': 'DoubleDelta'}, None), ('SimpleAggregateFunction(sum, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, None), ('SimpleAggregateFunction(anyLast, String)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], ('codec_type_unsupported', 'codec Delta does not support type String in SimpleAggregateFunction(anyLast, String)')), ('SimpleAggregateFunction(anyLast, String)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type String in SimpleAggregateFunction(anyLast, String)')), ('SimpleAggregateFunction(max, Nullable(UInt16))', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('SimpleAggregateFunction(max, Nullable(UInt16))', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('SimpleAggregateFunction(groupUniqArrayArray, Array(UInt32))', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('SimpleAggregateFunction(groupUniqArrayArray, Array(UInt32))', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 1, 'b' = 2)", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 1, 'b' = 2)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 1, 'b' = 1000)", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 1, 'b' = 1000)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum16('a' = 1)", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum16('a' = 1)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple(Float32, Float64)', {'kind': 'FPC', 'level': 12, 'floatSize': 4}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4)'}, None), ('Tuple(Float32, Float64)', {'kind': 'FPC', 'level': 12}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12)'}, None), ('Tuple(Float32, Float64)', {'kind': 'FPC'}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), ZSTD'}, None), ('Tuple(Float32, Float64)', {'kind': 'Gorilla'}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(Float32, Float64)', {'kind': 'Gorilla', 'size': 4}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla(4)'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, ZSTD'}, None), ('Tuple(Float64, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], None), ('Tuple(Float64, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple(Float64, Float64)', {'kind': 'FPC', 'level': 12, 'floatSize': 4}, None), ('Tuple(Float64, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4)'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_chain_float_order', 'codec chain puts FPC after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, FPC(12, 4)'}, ('codec_chain_float_order', 'codec chain puts FPC after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta', 'size': 2}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta(2), ZSTD'}, None), ('Tuple(UInt32, Float64)', [{'kind': 'Delta'}, {'kind': 'Gorilla'}], ('codec_chain_float_order', 'codec chain puts Gorilla after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Tuple(UInt32, Float64)', {'kind': 'raw', 'expression': 'Delta, Gorilla'}, ('codec_chain_float_order', 'codec chain puts Gorilla after Delta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Map(String, Float32)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 8}], ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, Float32)')), ('Map(String, Float32)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, Float32)')), ('Map(UInt32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_type_unsupported', 'codec FPC does not support type UInt32 in Map(UInt32, Float64)')), ('Map(UInt32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, ('codec_type_unsupported', 'codec FPC does not support type UInt32 in Map(UInt32, Float64)')), ('Map(UInt64, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Map(UInt64, Float64)')), ('Map(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Map(UInt64, Float64)')), ('Array(Tuple(Float32, Float64))', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], None), ('Array(Tuple(Float32, Float64))', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple(Float32, Float64)', [{'kind': 'T64'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_type_unsupported', 'codec T64 does not support type Float32 in Tuple(Float32, Float64)')), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'T64, FPC(12, 4)'}, ('codec_type_unsupported', 'codec T64 does not support type Float32 in Tuple(Float32, Float64)')), ('Tuple(Float32, Float64)', [{'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'DoubleDelta, ZSTD'}, None), ('Tuple(UInt16, UInt64)', [{'kind': 'DoubleDelta'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_chain_float_order', 'codec chain puts FPC after DoubleDelta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Tuple(UInt16, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta, FPC(12, 4)'}, ('codec_chain_float_order', 'codec chain puts FPC after DoubleDelta; Gorilla, FPC and ALP do their own delta encoding and cannot follow Delta or DoubleDelta')), ('Tuple(Float32, Float64)', {'kind': 'ALP'}, None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'ALP'}, None), ('String', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('String', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('String', [{'kind': 'Delta', 'size': 1}, {'kind': 'LZ4'}], None), ('String', {'kind': 'raw', 'expression': 'Delta(1), LZ4'}, None), ('String', [{'kind': 'Delta'}, {'kind': 'LZ4'}], ('codec_type_unsupported', 'codec Delta does not support type String')), ('String', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type String')), ('String', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type String: no float leaf reachable through Nullable, Array or Tuple')), ('String', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type String: no float leaf reachable through Nullable, Array or Tuple')), ('String', {'kind': 'DoubleDelta', 'size': 8}, ('codec_type_unsupported', 'codec DoubleDelta does not support type String')), ('String', {'kind': 'raw', 'expression': 'DoubleDelta(8)'}, ('codec_type_unsupported', 'codec DoubleDelta does not support type String')), ('String', {'kind': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String')), ('String', {'kind': 'raw', 'expression': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String')), ('FixedString(4)', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('FixedString(4)', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('FixedString(4)', {'kind': 'Gorilla', 'size': 4}, ('codec_type_unsupported', 'codec Gorilla does not support type FixedString(4): no float leaf reachable through Nullable, Array or Tuple')), ('FixedString(4)', {'kind': 'raw', 'expression': 'Gorilla(4)'}, ('codec_type_unsupported', 'codec Gorilla does not support type FixedString(4): no float leaf reachable through Nullable, Array or Tuple')), ('Array(String)', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('Array(String)', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('Nullable(String)', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('Nullable(String)', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('LowCardinality(String)', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('LowCardinality(String)', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('UUID', [{'kind': 'Delta', 'size': 8}, {'kind': 'LZ4'}], None), ('UUID', {'kind': 'raw', 'expression': 'Delta(8), LZ4'}, None), ('UUID', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type UUID: no float leaf reachable through Nullable, Array or Tuple')), ('UUID', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type UUID: no float leaf reachable through Nullable, Array or Tuple')), ('Decimal(18, 4)', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type Decimal(18, 4): no float leaf reachable through Nullable, Array or Tuple')), ('Decimal(18, 4)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type Decimal(18, 4): no float leaf reachable through Nullable, Array or Tuple')), ('Decimal(18, 4)', [{'kind': 'Delta', 'size': 8}, {'kind': 'LZ4'}], None), ('Decimal(18, 4)', {'kind': 'raw', 'expression': 'Delta(8), LZ4'}, None), ('UInt64', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt64: no float leaf reachable through Nullable, Array or Tuple')), ('UInt64', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt64: no float leaf reachable through Nullable, Array or Tuple')), ('Date', {'kind': 'Gorilla', 'size': 2}, ('codec_type_unsupported', 'codec Gorilla does not support type Date: no float leaf reachable through Nullable, Array or Tuple')), ('Date', {'kind': 'raw', 'expression': 'Gorilla(2)'}, ('codec_type_unsupported', 'codec Gorilla does not support type Date: no float leaf reachable through Nullable, Array or Tuple')), ('Float64', [{'kind': 'Delta', 'size': 8}, {'kind': 'LZ4'}], None), ('Float64', {'kind': 'raw', 'expression': 'Delta(8), LZ4'}, None), ('Tuple(UInt64, Float64)', {'kind': 'Gorilla'}, None), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(UInt64, Float64)', {'kind': 'Gorilla', 'size': 8}, None), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, None), ('Tuple(String, Float64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Tuple(String, Float64)')), ('Tuple(String, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Tuple(String, Float64)')), ('Tuple(String, UInt64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], ('codec_type_unsupported', 'codec Delta does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'DoubleDelta'}, ('codec_type_unsupported', 'codec DoubleDelta does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, ('codec_type_unsupported', 'codec DoubleDelta does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', [{'kind': 'GCD'}, {'kind': 'LZ4'}], ('codec_type_unsupported', 'codec GCD does not support type String in Tuple(String, UInt64)')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'GCD, LZ4'}, ('codec_type_unsupported', 'codec GCD does not support type String in Tuple(String, UInt64)')), ('Tuple(UInt64, Float64)', {'kind': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type Float64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type Float64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(String, Float64)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type String in Tuple(String, Float64)')), ('Tuple(String, Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type String in Tuple(String, Float64)')), ('Map(String, Float64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, Float64)')), ('Map(String, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, Float64)')), ('Map(String, UInt64)', {'kind': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String in Map(String, UInt64)')), ('Map(String, UInt64)', {'kind': 'raw', 'expression': 'T64'}, ('codec_type_unsupported', 'codec T64 does not support type String in Map(String, UInt64)')), ('Map(String, UInt64)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], ('codec_type_unsupported', 'codec Delta does not support type String in Map(String, UInt64)')), ('Map(String, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type String in Map(String, UInt64)')), ('Map(String, String)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, String)')), ('Map(String, String)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type String in Map(String, String)')), ('Array(Tuple(UInt64, Float64))', {'kind': 'Gorilla'}, None), ('Array(Tuple(UInt64, Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(UInt64, Decimal(18, 4))', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(UInt64, Decimal(18, 4)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(UInt64, Decimal(18, 4))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(UInt64, Decimal(18, 4)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(UInt64, String)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, String)')), ('Tuple(UInt64, String)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, String)')), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': 0}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, 0)'}, None), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': 9}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, 9)'}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': 10}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, 10)'}, None), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': 31}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, 31)'}, None), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': 32}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, 32)'}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'ZSTD', 'level': 3, 'windowLog': -1}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(3, -1)'}, ('codec_parameter_invalid', 'codec ZSTD windowLog must be 0 or an integer between 10 and 31')), ('UInt64', {'kind': 'ZSTD', 'level': 1, 'windowLog': 0}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(1, 0)'}, None), ('UInt64', {'kind': 'ZSTD', 'level': -1, 'windowLog': 0}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(-1, 0)'}, None), ('UInt64', {'kind': 'ZSTD', 'level': 0, 'windowLog': 0}, None), ('UInt64', {'kind': 'raw', 'expression': 'ZSTD(0, 0)'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla', 'size': 4}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla(4), FPC(12, 4)'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4), ZSTD'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'LZ4HC'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, LZ4HC'}, None), ('Tuple(Float32, Float64)', [{'kind': 'Gorilla'}, {'kind': 'ZSTD', 'level': 3, 'windowLog': 24}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, ZSTD(3, 24)'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'LZ4HC'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4HC'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'T64'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, T64'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'DoubleDelta'}, {'kind': 'Delta'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta, Delta, ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'DoubleDelta', 'size': 4}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, DoubleDelta(4)'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'Gorilla'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), Gorilla'}, None), ('Map(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'ZSTD'}], None), ('Map(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, ZSTD'}, None), ('Tuple(UInt32, Float32)', [{'kind': 'Delta'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, Float32)', {'kind': 'raw', 'expression': 'Delta, ZSTD'}, None), ('Tuple(UInt64, Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(UInt64, Float64)')), ('Tuple(UInt64, Float64)', [{'kind': 'Gorilla'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla, ZSTD'}, None), ('Nullable(Float64)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], None), ('Nullable(Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Array(Float32)', [{'kind': 'Gorilla'}, {'kind': 'FPC', 'level': 12, 'floatSize': 8}], None), ('Array(Float32)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 8)'}, None), # ClickHouse 26.3 LowCardinality codec restrictions (typed and raw). ('LowCardinality(Float32)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'Gorilla', 'size': 4}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'raw', 'expression': 'Gorilla(4)'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'raw', 'expression': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', [{'kind': 'Gorilla'}, {'kind': 'ZSTD'}], ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', {'kind': 'raw', 'expression': 'Gorilla, ZSTD'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', [{'kind': 'FPC'}, {'kind': 'ZSTD'}], ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', {'kind': 'raw', 'expression': 'FPC, ZSTD'}, ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(UInt64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(UInt64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(UInt64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(UInt64): no float leaf reachable through Nullable, Array or Tuple')), ('Array(LowCardinality(Float64))', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Array(LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Array(LowCardinality(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Array(LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Nullable(Float64))', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Nullable(Float64) in LowCardinality(Nullable(Float64))')), ('LowCardinality(Nullable(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Nullable(Float64) in LowCardinality(Nullable(Float64))')), ('LowCardinality(Float64)', {'kind': 'DoubleDelta'}, None), ('LowCardinality(Float64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, None), ('LowCardinality(Float64)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('LowCardinality(Float64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('LowCardinality(Float64)', {'kind': 'ZSTD'}, None), ('LowCardinality(Float64)', {'kind': 'raw', 'expression': 'ZSTD'}, None), ('LowCardinality(UInt64)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('LowCardinality(UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('LowCardinality(UInt64)', {'kind': 'DoubleDelta'}, None), ('LowCardinality(UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, None), ('LowCardinality(UInt64)', {'kind': 'T64'}, None), ('LowCardinality(UInt64)', {'kind': 'raw', 'expression': 'T64'}, None), ('LowCardinality(UInt64)', [{'kind': 'GCD'}, {'kind': 'LZ4'}], None), ('LowCardinality(UInt64)', {'kind': 'raw', 'expression': 'GCD, LZ4'}, None), ('LowCardinality(Date)', [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ('LowCardinality(Date)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('LowCardinality(String)', [{'kind': 'Delta', 'size': 4}, {'kind': 'LZ4'}], None), ('LowCardinality(String)', {'kind': 'raw', 'expression': 'Delta(4), LZ4'}, None), ('LowCardinality(String)', {'kind': 'ZSTD'}, None), ('LowCardinality(String)', {'kind': 'raw', 'expression': 'ZSTD'}, None), # Parser coverage: unknown siblings and quoted type-like text. ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'Gorilla'}, ("codec_type_unsupported", "codec Gorilla does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ("codec_type_unsupported", "codec Gorilla does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'FPC'}, ("codec_type_unsupported", "codec FPC does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'raw', 'expression': 'FPC'}, ("codec_type_unsupported", "codec FPC does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'ALP'}, ("codec_type_unsupported", "codec ALP does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ('Tuple(JSON, LowCardinality(Float64))', {'kind': 'raw', 'expression': 'ALP'}, ("codec_type_unsupported", "codec ALP does not support type Tuple(JSON, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple")), ("Tuple(Enum8('LowCardinality(Float64)' = 1), Float64)", {'kind': 'Gorilla'}, None), ("Tuple(Enum8('LowCardinality(Float64)' = 1), Float64)", {'kind': 'raw', 'expression': 'Gorilla'}, None), # ClickHouse 26.3 float-series and type-parser server matrices: 60 inputs. ('Tuple(LowCardinality(UInt64), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(LowCardinality(Float64), Float64)', {'kind': 'raw', 'expression': 'FPC'}, None), ('Tuple(LowCardinality(Float64), Float64)', {'kind': 'raw', 'expression': 'ALP'}, None), ('Tuple(a LowCardinality(Float32), b Float32)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(LowCardinality(Float64), LowCardinality(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(LowCardinality(Float64), LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(LowCardinality(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(LowCardinality(Float64))', {'kind': 'raw', 'expression': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type Tuple(LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(LowCardinality(Float64))', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type Tuple(LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Array(Tuple(LowCardinality(Float64), Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(Array(LowCardinality(Float64)), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Array(Array(LowCardinality(Float64)))', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type Array(Array(LowCardinality(Float64))): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, LowCardinality(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, LowCardinality(Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Map(LowCardinality(Float64), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(LowCardinality(Float64), Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(LowCardinality(UInt64), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(LowCardinality(UInt64), Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt32, Float32)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt32, Float32): no float leaf reachable through Nullable, Array or Tuple')), ('Map(Float64, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(Float64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(Float64, Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type Map(Float64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(Float64, Float64)', {'kind': 'raw', 'expression': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type Map(Float64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Map(UInt64, Float64)')), ('Tuple(Map(UInt64, Float64), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Array(Map(UInt64, Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Array(Map(UInt64, Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(Map(Float64, Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(Map(Float64, Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, Tuple(Float64, Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, Tuple(Float64, Float64)): no float leaf reachable through Nullable, Array or Tuple')), ('Nullable(Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Array(Nullable(Float64))', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(Nullable(Float64), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Array(Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(Float64, Float64)', {'kind': 'raw', 'expression': 'ALP'}, None), ('Map(UInt64, UInt64)', {'kind': 'raw', 'expression': 'T64'}, None), ('Map(UInt64, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('Map(UInt64, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, None), ('Map(UInt64, Float64)', {'kind': 'raw', 'expression': 'DoubleDelta'}, None), ('Tuple (Float32, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple (Float64, Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Nullable (Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Array (UInt32)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum ('a' = 1, 'b' = 1000)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('SimpleAggregateFunction (sum, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('Tuple(`a\\`x` Float32, b Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple(`a b` Float32, b Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ('Tuple("a" Float32, b Float64)', {'kind': 'raw', 'expression': 'Gorilla, FPC(12, 4)'}, None), ("Enum('a', 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 127, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a', 'b' = 1000)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum8('a', 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = -129)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = -128, 'b' = 127)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ('Tuple(UInt128, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt128 in Tuple(UInt128, Float64)')), ('Tuple(FixedString(3), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type FixedString(3) in Tuple(FixedString(3), Float64)')), ('Tuple(FixedString(8), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(UInt128, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, None), ('Tuple(Int256, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Int256 in Tuple(Int256, Float64)')), ('Tuple(Decimal(38, 4), Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type Decimal(38, 4) in Tuple(Decimal(38, 4), Float64)')), ('Tuple(UUID, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type UUID in Tuple(UUID, Float64)')), ('Tuple(IPv6, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type IPv6 in Tuple(IPv6, Float64)')), ('Tuple(Date32, Float64)', {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(UInt128, UInt64)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type UInt128 in Tuple(UInt128, UInt64)')), ('UInt128', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type UInt128')), ('FixedString(3)', {'kind': 'raw', 'expression': 'Delta, LZ4'}, ('codec_type_unsupported', 'codec Delta does not support type FixedString(3)')), # Opaque containers, explicit widths and per-leaf checks. ('LowCardinality(Float32)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float32)', {'kind': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type LowCardinality(Float32): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(Float64)', {'kind': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type LowCardinality(Float64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(UInt64)', {'kind': 'Gorilla'}, ('codec_type_unsupported', 'codec Gorilla does not support type LowCardinality(UInt64): no float leaf reachable through Nullable, Array or Tuple')), ('LowCardinality(UInt64)', {'kind': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in LowCardinality(UInt64)')), ('LowCardinality(UInt64)', {'kind': 'ALP'}, ('codec_type_unsupported', 'codec ALP does not support type UInt64 in LowCardinality(UInt64)')), ('Tuple(Map(UInt64, Float64), Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(Map(UInt64, Float64), Float64)')), ('Tuple(LowCardinality(UInt64), Float64)', {'kind': 'raw', 'expression': 'FPC'}, ('codec_type_unsupported', 'codec FPC does not support type UInt64 in Tuple(LowCardinality(UInt64), Float64)')), ('Tuple(LowCardinality(Float64), Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, None), ('Map(Float64, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(Float64, Float64): no float leaf reachable through Nullable, Array or Tuple')), # Opus review: mixed-width codecs, Enum integer literals and explicit Gorilla. ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'DoubleDelta'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), DoubleDelta'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), DoubleDelta, ZSTD'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 8}, {'kind': 'DoubleDelta'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 8), DoubleDelta'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 8}, {'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 8), DoubleDelta, ZSTD'}, None), ('Tuple(Float32, Float64)', [{'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'DoubleDelta, ZSTD'}, None), ('Tuple(Float32, Float64)', [{'kind': 'DoubleDelta', 'size': 4}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'DoubleDelta(4), ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta, ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'DoubleDelta', 'size': 4}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'DoubleDelta(4), ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'T64'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'T64, ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'T64', 'mode': 'byte'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': "T64('byte'), ZSTD"}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'GCD'}, {'kind': 'ZSTD'}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'GCD, ZSTD'}, None), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'ZSTD'}], None), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), ZSTD'}, None), ('Float64', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'DoubleDelta'}, {'kind': 'ZSTD'}], None), ('Float64', {'kind': 'raw', 'expression': 'FPC(12, 4), DoubleDelta, ZSTD'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'DoubleDelta', 'size': 4}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, DoubleDelta(4)'}, None), ('Tuple(UInt32, UInt64)', [{'kind': 'Delta'}, {'kind': 'DoubleDelta', 'size': 8}], None), ('Tuple(UInt32, UInt64)', {'kind': 'raw', 'expression': 'Delta, DoubleDelta(8)'}, None), ("Enum('a' = 0x10)", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 0x10)", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 0x7f, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 0x7f, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = -0x80, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = -0x80, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 1_0, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 1_0, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = +0b1111111, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = +0b1111111, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = 0x0_7f, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = 0x0_7f, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Enum('a' = -1_2_8, 'b')", [{'kind': 'Delta'}, {'kind': 'LZ4'}], None), ("Enum('a' = -1_2_8, 'b')", {'kind': 'raw', 'expression': 'Delta, LZ4'}, None), ("Tuple(Enum('a' = 0x10), Float64)", {'kind': 'Gorilla'}, None), ("Tuple(Enum('a' = 0x10), Float64)", {'kind': 'raw', 'expression': 'Gorilla'}, None), ('Tuple(String, Float64)', {'kind': 'Gorilla', 'size': 8}, None), ('Tuple(String, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, None), ('Tuple(UUID, Float64)', {'kind': 'Gorilla', 'size': 8}, None), ('Tuple(UUID, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, None), ('String', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type String: no float leaf reachable through Nullable, Array or Tuple')), ('String', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type String: no float leaf reachable through Nullable, Array or Tuple')), ('UInt64', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt64: no float leaf reachable through Nullable, Array or Tuple')), ('UInt64', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type UInt64: no float leaf reachable through Nullable, Array or Tuple')), ('UUID', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type UUID: no float leaf reachable through Nullable, Array or Tuple')), ('UUID', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type UUID: no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, Float64)', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Map(UInt64, Float64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type Map(UInt64, Float64): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(String, UInt64)', {'kind': 'Gorilla', 'size': 8}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(String, UInt64): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(String, UInt64)', {'kind': 'raw', 'expression': 'Gorilla(8)'}, ('codec_type_unsupported', 'codec Gorilla does not support type Tuple(String, UInt64): no float leaf reachable through Nullable, Array or Tuple')), ('Tuple(String, Float64)', [{'kind': 'Gorilla', 'size': 4}, {'kind': 'FPC', 'level': 12, 'floatSize': 4}], ('codec_type_unsupported', 'codec FPC does not support type String in Tuple(String, Float64)')), ('Tuple(String, Float64)', {'kind': 'raw', 'expression': 'Gorilla(4), FPC(12, 4)'}, ('codec_type_unsupported', 'codec FPC does not support type String in Tuple(String, Float64)')), ('Tuple(Float32, Float64)', [{'kind': 'FPC', 'level': 12, 'floatSize': 4}, {'kind': 'T64'}], ('codec_type_unsupported', 'codec T64 does not support type Float32 in Tuple(Float32, Float64)')), ('Tuple(Float32, Float64)', {'kind': 'raw', 'expression': 'FPC(12, 4), T64'}, ('codec_type_unsupported', 'codec T64 does not support type Float32 in Tuple(Float32, Float64)')), ] @pytest.mark.parametrize(("type_", "codec", "expected"), CASES) def test_column_codec_rules(type_: str, codec: Any, expected: tuple[str, str] | None) -> None: definition = table( database="app", name="events", engine="MergeTree()", primary_key=["id"], order_by=["id"], columns=[{"name": "id", "type": "UInt64"}, {"name": "c", "type": type_, "codec": codec}], ) issues = [(issue.code, issue.message) for issue in validate_definitions([definition])] assert issues == ( [(expected[0], f'Table app.events column "c" {expected[1]}')] if expected else [] )