databasefile-uploadbigdataolapapache-doris

Why can't the same label be re-imported in Apache Doris?


Why can't you use the same label load data to Doris twice? Is there an expiration date about label?

I use a label to load data twice and my load job failed. I want to know why I can't use the same label.

The steps to reproduce are below:

  1. create table:
create  TABLE IF NOT EXISTS test.test
(id int, name varchar(20))ENGINE = olap
duplicate key(id)
DISTRIBUTED BY HASH(`id`) BUCKETS 2
PROPERTIES ("replication_num" = "1");
  1. data file content:
1,a
2,b
  1. execute load command:
curl --location-trusted -u root:  -H "format: csv" -H "column_separator:,"  -H "label:my_label1" -T a.txt http://my_fe_ip:8030/api/test/test/_stream_load
  1. re-execute load command with the same label:
curl --location-trusted -u root:  -H "format: csv" -H "column_separator:,"  -H "label:my_label1" -T a.txt http://my_fe_ip:8030/api/test/test/_stream_load
  1. then I get an error:

"Message": "[LABEL_ALREADY_EXISTS]TStatus: errCode = 2, detailMessage = Label [my_label1] has already been used, relate to txn [5], status [VISIBLE].",


Solution

  • In Doris, label is an important feature for transaction guarantee in import tasks. Different labels should be used to distinguish between two import tasks to avoid conflicts in import transactions