【详述】按照官方给的StarRocks外表写入文档,出现错误,请教具体原因。
【StarRocks版本】2.2.5
【集群规模】测试环境,外表集群1BE/1FE,目标集群1BE/1FE
【表模型】Duplicate Key
【导入或者导出方式】StarRocks外表
【联系方式】jimokanghanchao@gmail.com
【附件】
操作过程:
-
目标创建表t
CREATE TABLEt
(
k1
date NULL COMMENT “”,
k2
int(11) NULL COMMENT “”,
k3
smallint(6) NULL COMMENT “”,
k4
varchar(2048) NULL COMMENT “”,
k5
datetime NULL COMMENT “”
) ENGINE=OLAP
DUPLICATE KEY(k1
,k2
,k3
)
COMMENT “OLAP”
DISTRIBUTED BY HASH(k1
) BUCKETS 10
PROPERTIES (
“replication_num” = “1”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”
); -
外表集群创建外表external_t
mysql> CREATE EXTERNAL TABLE external_t
-> (
-> k1 DATE,
-> k2 INT,
-> k3 SMALLINT,
-> k4 VARCHAR(2048),
-> k5 DATETIME
-> )
-> ENGINE=olap
-> DISTRIBUTED BY HASH(k1) BUCKETS 10
-> PROPERTIES
-> (
-> “host” = “10.1.2.70”,
-> “port” = “9030”,
-> “user” = “root”,
-> “password” = “”,
-> “database” = “test”,
-> “table” = “t”
-> );
Query OK, 0 rows affected (0.00 sec)
// show create table external_t
CREATE EXTERNAL TABLEexternal_t
(
k1
date NULL COMMENT “”,
k2
int(11) NULL COMMENT “”,
k3
smallint(6) NULL COMMENT “”,
k4
varchar(2048) NULL COMMENT “”,
k5
datetime NULL COMMENT “”
) ENGINE=OLAP_EXTERNAL
DUPLICATE KEY(k1
,k2
,k3
)
COMMENT “OLAP_EXTERNAL”
DISTRIBUTED BY HASH(k1
) BUCKETS 10
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”
“host” = “10.1.2.70”,
“port” = “9030”,
“user” = “root”,
“password” = “”,
“database” = “test”,
“table” = “t”
); -
外表集群,尝试写入外表,insert into external_t values (‘2020-10-11’, 1 , 1 , ‘hello’, ‘2020-10-11 10:00:00’);
错误:ERROR 1064 (HY000): data cannot be inserted into table with empty partition.UseSHOW PARTITIONS FROM external_t
to see the currently partitions of this table.
看了下fe的部分代码,是这个地方抛出的错误