ClickHouse/tests/queries/0_stateless/02811_ip_dict_attribute.sql
2023-07-04 02:19:45 +00:00

14 lines
397 B
SQL

CREATE TABLE src ( id UInt64, ip4 IPv4, ip6 IPv6 ) Engine=Memory AS
SELECT * FROM VALUES( (1, '1.1.1.1', '::1.1.1.1'), (2, '2.2.2.2', '::2.2.2.2') );
CREATE DICTIONARY dict ( id UInt64, ip4 IPv4, ip6 IPv6 )
PRIMARY KEY id
LAYOUT(HASHED())
SOURCE (CLICKHOUSE ( table src))
lifetime ( 10);
SELECT dictGet('dict', ('ip6', 'ip4'), arrayJoin([2,1]));
DROP DICTIONARY dict;
DROP TABLE src;