我可以从 sql 文件执行查询并将输出存储在本地文件中使用
hive -f /home/Prashasti/test.sql > /home/Prashasti/output.csv
此外,我可以使用以下方法将配置单元查询的输出存储在 hdfs 中:
insert overwrite directory 'user/output' select * from folders;
有什么方法可以从 sql 文件运行查询并将输出也存储在 hdfs 中吗?
最佳答案
只需要修改sql文件,将insert overwrite directory 'user/output'
添加到查询的前面。
关于hadoop - 配置单元 : How to execute a query from a file and dump the output in hdfs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25505286/