1. csv数据准备
1,张三,男,2023-03-22
2,李四,女,2023-03-22
3,王五,男,2023-03-22
4,赵六,男,2023-03-22
将数据写入csv local_file_load.csv文件 并放到服务器192.168.xx.xx的/data/palo_test_data/目录下
2. 创建doris目标表:
drop table if exists chengt.local_file_load;
create table chengt.local_file_load(
idvarchar(200),
namevarchar(200),
sexvarchar(200),
datevarchar(200)
)DISTRIBUTED BYHASH(id)
PROPERTIES (
"replication_allocation" = "tag.location.default:3", -- 副本数
"in_memory"= "false",
"storage_format"= "V2"
) ;
select * from chengt.local_file_load
3.1执行导入命令
[root@localhostpalo_test_data]# curl --location-trusted -u root:doris用户密码 -H"label:csvload1" -H "column_separator:,