Merging upstream version 15.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2e6df1bcfa
commit
3d4adf9c16
81 changed files with 40321 additions and 37940 deletions
|
@ -39,7 +39,16 @@ class TestClickhouse(Validator):
|
|||
self.validate_identity(
|
||||
"CREATE TABLE test (id UInt8) ENGINE=AggregatingMergeTree() ORDER BY tuple()"
|
||||
)
|
||||
self.validate_identity(
|
||||
"CREATE TABLE test ON CLUSTER default (id UInt8) ENGINE=AggregatingMergeTree() ORDER BY tuple()"
|
||||
)
|
||||
self.validate_identity(
|
||||
"CREATE MATERIALIZED VIEW test_view ON CLUSTER cl1 (id UInt8) ENGINE=AggregatingMergeTree() ORDER BY tuple() AS SELECT * FROM test_data"
|
||||
)
|
||||
|
||||
self.validate_all(
|
||||
r"'Enum8(\'Sunday\' = 0)'", write={"clickhouse": "'Enum8(''Sunday'' = 0)'"}
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT uniq(x) FROM (SELECT any(y) AS x FROM (SELECT 1 AS y))",
|
||||
read={
|
||||
|
@ -395,3 +404,91 @@ SET
|
|||
},
|
||||
pretty=True,
|
||||
)
|
||||
self.validate_all(
|
||||
"""
|
||||
CREATE DICTIONARY discounts_dict (
|
||||
advertiser_id UInt64,
|
||||
discount_start_date Date,
|
||||
discount_end_date Date,
|
||||
amount Float64
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(TABLE 'discounts'))
|
||||
LIFETIME(MIN 1 MAX 1000)
|
||||
LAYOUT(RANGE_HASHED(range_lookup_strategy 'max'))
|
||||
RANGE(MIN discount_start_date MAX discount_end_date)
|
||||
""",
|
||||
write={
|
||||
"clickhouse": """CREATE DICTIONARY discounts_dict (
|
||||
advertiser_id UInt64,
|
||||
discount_start_date DATE,
|
||||
discount_end_date DATE,
|
||||
amount Float64
|
||||
)
|
||||
PRIMARY KEY (id)
|
||||
SOURCE(CLICKHOUSE(
|
||||
TABLE 'discounts'
|
||||
))
|
||||
LIFETIME(MIN 1 MAX 1000)
|
||||
LAYOUT(RANGE_HASHED(
|
||||
range_lookup_strategy 'max'
|
||||
))
|
||||
RANGE(MIN discount_start_date MAX discount_end_date)""",
|
||||
},
|
||||
pretty=True,
|
||||
)
|
||||
self.validate_all(
|
||||
"""
|
||||
CREATE DICTIONARY my_ip_trie_dictionary (
|
||||
prefix String,
|
||||
asn UInt32,
|
||||
cca2 String DEFAULT '??'
|
||||
)
|
||||
PRIMARY KEY prefix
|
||||
SOURCE(CLICKHOUSE(TABLE 'my_ip_addresses'))
|
||||
LAYOUT(IP_TRIE)
|
||||
LIFETIME(3600);
|
||||
""",
|
||||
write={
|
||||
"clickhouse": """CREATE DICTIONARY my_ip_trie_dictionary (
|
||||
prefix TEXT,
|
||||
asn UInt32,
|
||||
cca2 TEXT DEFAULT '??'
|
||||
)
|
||||
PRIMARY KEY (prefix)
|
||||
SOURCE(CLICKHOUSE(
|
||||
TABLE 'my_ip_addresses'
|
||||
))
|
||||
LAYOUT(IP_TRIE())
|
||||
LIFETIME(MIN 0 MAX 3600)""",
|
||||
},
|
||||
pretty=True,
|
||||
)
|
||||
self.validate_all(
|
||||
"""
|
||||
CREATE DICTIONARY polygons_test_dictionary
|
||||
(
|
||||
key Array(Array(Array(Tuple(Float64, Float64)))),
|
||||
name String
|
||||
)
|
||||
PRIMARY KEY key
|
||||
SOURCE(CLICKHOUSE(TABLE 'polygons_test_table'))
|
||||
LAYOUT(POLYGON(STORE_POLYGON_KEY_COLUMN 1))
|
||||
LIFETIME(0);
|
||||
""",
|
||||
write={
|
||||
"clickhouse": """CREATE DICTIONARY polygons_test_dictionary (
|
||||
key Array(Array(Array(Tuple(Float64, Float64)))),
|
||||
name TEXT
|
||||
)
|
||||
PRIMARY KEY (key)
|
||||
SOURCE(CLICKHOUSE(
|
||||
TABLE 'polygons_test_table'
|
||||
))
|
||||
LAYOUT(POLYGON(
|
||||
STORE_POLYGON_KEY_COLUMN 1
|
||||
))
|
||||
LIFETIME(MIN 0 MAX 0)""",
|
||||
},
|
||||
pretty=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue