StarRocks v2.1 开始在更新模型和主键模型支持了Array类型>
-- before this PR:
mysql> create table t1(id bigint not null, ids array<int>) primary key(id) distributed by hash(id);
ERROR 1064 (HY000): Invalid aggregate function 'REPLACE' for 'ids'
mysql> create table t2(id bigint not null, ids array<int>) unique key(id) distributed by hash(id);
ERROR 1064 (HY000): Invalid aggregate function 'REPLACE' for 'ids'
mysql>
-- after this PR:
mysql> create table t1(id bigint not null, ids array<int>) primary key(id) distributed by hash(id);
Query OK, 0 rows affected (0.11 sec)
mysql> desc t1;
+-------+------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-------+---------+-------+
| id | BIGINT | No | true | NULL | |
| ids | ARRAY<INT> | Yes | false | NULL | |
+-------+------------+------+-------+---------+-------+
2 rows in set (0.00 sec)
mysql> create table t2(id bigint not null, ids array<int>) unique key(id) distributed by hash(id);
Query OK, 0 rows affected (0.13 sec)
mysql> desc t2;
+-------+------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-------+---------+-------+
| id | BIGINT | No | true | NULL | |
| ids | ARRAY<INT> | Yes | false | NULL | |
+-------+------------+------+-------+---------+-------+
2 rows in set (0.01 sec)
mysql>
-- ATT, resolve #1715
StarRocks招聘:
招解决方案,DBA,数据库研发,测试,前后端开发等岗位,
有意者请投递简历到hr@starrocks.com