操作步骤
1、建表
2、使用 create table as 复制步骤1创建的表
建表语句:
CREATE TABLE
IF NOT EXISTS test_table_01(
_id
varchar not null comment 'unique value',
_index
varchar not null comment 'table name',
_time
datetime (6) default current_timestamp(6) comment 'data insertion time - microseconds',
id
bigint COMMENT '',
name
varchar COMMENT '',
sex
varchar COMMENT '',
idcard
varchar COMMENT '',
telnumber
bigint COMMENT '',
type
bigint COMMENT '',
create_time
datetime (3) COMMENT '',
school
varchar COMMENT '',
uuid
varchar COMMENT '',
remark
varchar COMMENT ''
) UNIQUE KEY (_id
, _index
) DISTRIBUTED BY HASH (_id
, _index
) BUCKETS 8 PROPERTIES (
"replication_num" = "2",
"enable_unique_key_merge_on_write" = "true",
"store_row_column" = "true",
"row_store_page_size" = "16384"
)
复制表语句
create table test_table_02 as select * from test_table_01;
错误信息
Err:java.sql.SQLException: Unexpected exception: errCode = 2, detailMessage = Failed to execute CTAS Reason: errCode = 2, detailMessage = replication num should be less than the number of available backends. replication num is 3, available backend num is 2
doris版本:2.1.7
be副本数:2