字符串映射成整数
6.1 使用全局字典
insert into 方式
CREATE TABLE `t1` (
`uuid` varchar(65533) NOT NULL COMMENT "",
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT ""
) ENGINE=OLAP
PRIMARY KEY(`uuid`)
insert into t1 values ("c272007b-070b-a37b-3e4c-000000000000", DEFAULT);
select * from t1;
+--------------------------------------+------+
| uuid | id |
+--------------------------------------+------+
| c272007b-070b-a37b-3e4c-000000000000 | 1 |
+--------------------------------------+------+
CREATE TABLE `t2` (
`uuid` varchar(65533) NULL COMMENT "",
`c3` bigint(20) NULL AS dict_mapping('t1', uuid) COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`uuid`)
insert into t2(uuid) values ("c272007b-070b-a37b-3e4c-000000000000");
select * from t2;
+--------------------------------------+------+
| uuid | c3 |
+--------------------------------------+------+
| c272007b-070b-a37b-3e4c-000000000000 | 1 |
+--------------------------------------+------+
stream load
//支持,需要补充使用方式实例
routine load
//支持,需要补充使用方式实例
broker load
//支持,需要补充使用方式实例
6.2 bitmap_hash
不推荐使用,会导致 id 很稀疏,而且也不保证唯一