Doris如何把某张表的数据导出来?

提问者:帅平 问题分类:大数据

Doris如何把某张表的数据导出来?

1 个回答
帅的被人砍
帅的被人砍

doris中想要导出某张表的数据,可以使用如下的语法:

EXPORT TABLE db1.tbl1 
PARTITION (p1,p2)
[WHERE [expr]]
TO "hdfs://host/path/to/export/" 
PROPERTIES
(
    "label" = "mylabel",
    "column_separator"=",",
    "columns" = "col1,col2",
    "exec_mem_limit"="2147483648",
    "timeout" = "3600"
)
WITH BROKER "hdfs"
(
    "username" = "user",
    "password" = "passwd"
);

导出的话主要是依靠broker进程进行异步导出。并且只能导出到hdfs上,然后可以把hdfs上的文件下载下来查看。

发布于:4周前 (11-09)
少女榨汁机
少女榨汁机

贴一个具体的导出sql示例:

export Table demo.user
to 'hdfs://192.168.0.236:59000/demo/user'
PROPERTIES
(
    "label" = "user_label1",
    "column_separator"=",",
    "columns" = "id,name,age",
    "exec_mem_limit"="2147483648",
    "timeout" = "3600"
)
WITH BROKER "apache_hdfs_broker"
(
    "username" = "root",
    "password" = ""
);

发布于:4周前 (11-09)
我来回答