Using the Flink Doris Connector, you can load data generated by Flink (such as data read from Kafka or MySQL) into Doris in real-time.
Requires a user-deployed Flink cluster.
For detailed steps on loading data using Flink, please refer to Flink-Doris-Connector. The following steps demonstrate how to quickly load data using Flink.
CREATE TABLE `students` ( `id` INT NULL, `name` VARCHAR(256) NULL, `age` INT NULL ) ENGINE=OLAP UNIQUE KEY(`id`) COMMENT 'OLAP' DISTRIBUTED BY HASH(`id`) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" );
Run bin/sql-client.sh to open the FlinkSQL console
CREATE TABLE student_sink ( id INT, name STRING, age INT ) WITH ( 'connector' = 'doris', 'fenodes' = '10.16.10.6:28737', 'table.identifier' = 'test.students', 'username' = 'root', 'password' = '', 'sink.label-prefix' = 'doris_label' ); INSERT INTO student_sink values(1,'zhangsan',123)
select * from test.students; +------+----------+------+ | id | name | age | +------+----------+------+ | 1 | zhangsan | 123 | +------+----------+------+