版本:2.0.9
通过catalog将一个doris集群(版本1.2.7)数据迁移到另外一个集群(版本2.0.9),sql如下:
insert into iot.test select * from doris_catalog.iot.test where pt <= '20240611';
报错如下:
Execution failed: Error Failed to execute sql: java.sql.SQLException: (conn=19554) errCode = 2, detailMessage = Unsupported type 'UNSUPPORTED_TYPE' in '`doris_catalog`.`default_cluster:iot`.`test`.`metric`'.
metric是个json字段(1.2.7是jsonb类型,2.0.9是json类型)
1.2.7建表语句
CREATE TABLE `test` (
`pt` date NULL COMMENT '分区',
`device_id` varchar(128) NULL COMMENT '设备ID',
`metric` jsonb NULL COMMENT '指标'
)
DUPLICATE KEY(`pt`, `device_id`)
DISTRIBUTED BY HASH(`device_id`) BUCKETS 1 PROPERTIES (
"replication_allocation" = "tag.location.default: 3"
);
2.0.9建表语句
CREATE TABLE `test` (
`pt` date NULL COMMENT '分区',
`device_id` varchar(128) NULL COMMENT '设备ID',
`metric` json NULL COMMENT '指标'
)
DUPLICATE KEY(`pt`, `device_id`)
DISTRIBUTED BY HASH(`device_id`) BUCKETS 1 PROPERTIES (
"replication_allocation" = "tag.location.default: 3"
);