__DORIS_SEQUENCE_COL__. The type of this column is specified by the user when creating the table, the specific value of this column is determined when importing, and this value is used to replace the column of REPLACE.__DORIS_SEQUENCE_COL__ will be automatically added according to the type specified by the user.order by expression (Broker load and Routine load), or the value of the function_column.sequence_col expression (stream load) during parsing. Value column will be replaced according to this value. The value of the hidden column __DORIS_SEQUENCE_COL__ can be set as one column in the data source or one column in the table structure.__DORIS_SEQUENCE_COL__ column. This column is used as the basis for the replacement order of the REPLACE Aggregate function under the same Key column. Larger values can replace smaller values. Otherwise, they cannot be replaced.__DORIS_SEQUENCE_COL__
The main design aspect of the import syntax is to add a map from sequence columns to other columns, which will be introduced below in various import methods.PROPERTIES ("function_column.sequence_type" = 'Date',);
function_column.sequence_col field in the header, for example:curl --location-trusted -u root -H "columns: k1,k2,source_sequence,v1,v2" -H "function_column.sequence_col: source_sequence" -T testData http://host:port/api/testDb/testTbl/_stream_load
ORDER BY.LOAD LABEL db1.label1(DATA INFILE("hdfs://host:port/user/data/*/test.txt")INTO TABLEtbl1COLUMNS TERMINATED BY ","(k1,k2,source_sequence,v1,v2)ORDER BY source_sequence)WITH BROKER 'broker'("username"="user","password"="pass")PROPERTIES("timeout" = "3600");
CREATE ROUTINE LOAD example_db.test1 ON example_tbl[WITH MERGE|APPEND|DELETE]COLUMNS(k1, k2, source_sequence, v1, v2),WHERE k1 > 100 and k2 like "%doris%"[ORDER BY source_sequence]PROPERTIES("desired_concurrent_number"="3","max_batch_interval" = "20","max_batch_rows" = "300000","max_batch_size" = "209715200","strict_mode" = "false")FROM KAFKA("kafka_broker_lsequence_typeist" = "broker1:9092,broker2:9092,broker3:9092","kafka_topic" = "my_topic","kafka_partitions" = "0,1,2,3","kafka_offsets" = "101,0,0,200");
function_column.sequence_type when creating a new table, the new table will support sequence column.
For a table that does not support sequence column, if you want to use this feature, you can use the following statement to enable it.ALTER TABLE example_db.my_table ENABLE FEATURE "SEQUENCE_LOAD" WITH PROPERTIES ("function_column.sequence_type" = "Date")
SET show_hidden_columns=true, and then use desc tablename. It supports if the output has a __DORIS_SEQUENCE_COL__ column then it supports; if not, it does not support.MySQL > desc test_table;+-------------+--------------+------+-------+---------+---------+| Field | Type | Null | Key | Default | Extra |+-------------+--------------+------+-------+---------+---------+| user_id | BIGINT | No | true | NULL | || date | DATE | No | true | NULL | || group_id | BIGINT | No | true | NULL | || modify_date | DATE | No | false | NULL | REPLACE || keyword | VARCHAR(128) | No | false | NULL | REPLACE |+-------------+--------------+------+-------+---------+---------+
1 2020-02-22 1 2020-02-22 a1 2020-02-22 1 2020-02-22 b1 2020-02-22 1 2020-03-05 c1 2020-02-22 1 2020-02-26 d1 2020-02-22 1 2020-02-22 e1 2020-02-22 1 2020-02-22 b
curl --location-trusted -u root: -H "function_column.sequence_col: modify_date" -T testData http://host:port/api/test/test_table/_stream_load
MySQL > select * from test_table;+---------+------------+----------+-------------+---------+| user_id | date | group_id | modify_date | keyword |+---------+------------+----------+-------------+---------+| 1 | 2020-02-22 | 1 | 2020-03-05 | c |+---------+------------+----------+-------------+---------+
1 2020-02-22 1 2020-02-22 a1 2020-02-22 1 2020-02-23 b
MySQL [test]> select * from test_table;+---------+------------+----------+-------------+---------+| user_id | date | group_id | modify_date | keyword |+---------+------------+----------+-------------+---------+| 1 | 2020-02-22 | 1 | 2020-03-05 | c |+---------+------------+----------+-------------+---------+
1 2020-02-22 1 2020-02-22 a1 2020-02-22 1 2020-03-23 w
MySQL [test]> select * from test_table;+---------+------------+----------+-------------+---------+| user_id | date | group_id | modify_date | keyword |+---------+------------+----------+-------------+---------+| 1 | 2020-02-22 | 1 | 2020-03-23 | w |+---------+------------+----------+-------------+---------+
Feedback