写入StarRocks外表错误

【详述】按照官方给的StarRocks外表写入文档,出现错误,请教具体原因。
【StarRocks版本】2.2.5
【集群规模】测试环境,外表集群1BE/1FE,目标集群1BE/1FE
【表模型】Duplicate Key
【导入或者导出方式】StarRocks外表
【联系方式】jimokanghanchao@gmail.com
【附件】
操作过程:

  1. 目标创建表t
    CREATE TABLE 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
    DUPLICATE KEY(k1, k2, k3)
    COMMENT “OLAP”
    DISTRIBUTED BY HASH(k1) BUCKETS 10
    PROPERTIES (
    “replication_num” = “1”,
    “in_memory” = “false”,
    “storage_format” = “DEFAULT”
    );

  2. 外表集群创建外表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 TABLE external_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”
    );

  3. 外表集群,尝试写入外表,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.Use SHOW PARTITIONS FROM external_t to see the currently partitions of this table.
    看了下fe的部分代码,是这个地方抛出的错误

9030 -> 9020 Try

1赞

感谢!一时间脑子瓦特了。

这个很容易误解,其实,我们已经在优化了,后面的版本会,支持9030端口

老师好,我们用的2.5.8版本,外表端口确认是9020,也出现了同样错误,还有什么可能的原因呢?
data cannot be inserted into table with empty partition.Use SHOW PARTITIONS FROM zzlib_test_app_lqc_cs_kpi_sum_d to see the currently partitions of this table.

测试下端口是否是通的,两个集群间

端口是通的,现象是,刚创建完目标表和源对应的外表后,会报上述错误,等待几分钟后可以正常执行insert。

查看源码,有讲解如果表为分区表,在表之后会创建分区,需要等待的提示。后测试,未指定分区的表同样存在创建后导入报错,等待一会后可以正常导入。

元数据同步需要点时间