doris SQL

Last updated on November 22, 2024 pm

🧙 Questions

☄️ Ideas

建表
CREATE DATABASE ispong_db;
CREATE TABLE ispong_db.users
(
  username  VARCHAR (32) ,
  age       INT
)
UNIQUE KEY (username)
DISTRIBUTED BY HASH(username) BUCKETS 10
PROPERTIES("replication_num" = "1");
FE操作
SHOW PROC '/frontends';
BE操作
-- 添加BE
ALTER SYSTEM ADD BACKEND "172.26.34.173:9050";
-- ALTER SYSTEM DECOMMISSION BACKEND "172.23.39.227:30136";

-- 查看BE
SHOW PROC '/backends';
查看broker
-- 添加BROKER
ALTER SYSTEM ADD BROKER ispong_broker "172.26.34.173:8000";

-- 查看broker
SHOW PROC '/brokers';
登录doris

Doris可以通过mysql的客户端直接访问

# mysql -h 192.168.21.76 -u test -pxxbjac,123 -P 9030  
mysql -h ${host} -u ${user} -p${password} -P ${port}
LOAD相关命令

strip_outer_array false 不为数组 true一定要传一个数组

USE ${dbName};
-- 创建LOAD
CREATE ROUTINE LOAD ispong_flink ON test_for_flink COLUMNS (
  username,
  age
) PROPERTIES (
    "desired_concurrent_number" = "1",
    "max_error_number" = "10000000000",
    "max_batch_interval" = "5",
    "desired_concurrent_number"="1",
    "max_batch_rows" = "200000",
    "max_batch_size" = "104857600",
    "strict_mode" = "false",
    "format" = "json",
    "strip_outer_array" = "false"
) FROM KAFKA (
    "kafka_broker_list" = "192.168.16.75:9092",
    "kafka_topic" = "output_doris_topic",
    "kafka_partitions" = "0"
);
-- 查看LOAD
SHOW ROUTINE LOAD;
SHOW ROUTINE LOAD TASK WHERE JobName = "ispong_flink";
SHOW ROUTINE LOAD FOR ispong_flink;
-- 暂停LOAD
PAUSE ROUTINE LOAD FOR ispong_flink; 
-- 恢复LOAD
RESUME ROUTINE LOAD FOR ispong_flink;
-- 暂停LOAD
STOP ROUTINE LOAD FOR ispong_flink;
查看版本号
SHOW FRONTENDS;
SHOW PROC '/backends';

doris SQL
https://ispong.isxcode.com/db/doris/doris SQL/
Author
ispong
Posted on
April 16, 2022
Licensed under