“插入覆盖本地目录”在 Hive 中是什么意思?

frm*_*aul 5 hive hiveql

我在理解以下类型的查询的作用时遇到了一些问题:

insert overwrite local directory $directorey_name$ select $some_query$

这是什么意思,这有什么副作用?

Dav*_*itz 5

将查询结果导出到本地文件系统上的文件中

insert overwrite local directory '/tmp/hello'
row format delimited
fields terminated by '|'
select 1,2,3,'Hello','world'
;
Run Code Online (Sandbox Code Playgroud)
! ls /tmp/hello;
Run Code Online (Sandbox Code Playgroud)
000000_0
Run Code Online (Sandbox Code Playgroud)
! cat /tmp/hello/000000_0;
Run Code Online (Sandbox Code Playgroud)
1|2|3|Hello|world
Run Code Online (Sandbox Code Playgroud)