gpt4 book ai didi

hadoop - 配置单元结果未保存到S3存储桶中

转载 作者:行者123 更新时间:2023-12-02 20:56:14 25 4
gpt4 key购买 nike

我无法将Hive输出保存到S3。我已经尝试将ssh插入主节点并在Hive中运行我的命令,但是它不保存输出。我也尝试过从AWS的EMR控制台在Hue中运行命令,但仍然无法保存到S3。我还添加了脚本作为步骤,但仍然无法保存。我能够获得结果的唯一方法是在Hue中运行它,然后单击以查看结果并进行下载,然后将其推送到S3。我不知道为什么会这样。这是我正在运行的查询。

with temp as (
select /*+ streamtable(l) */ a.id, a.name, a.page
from my_table a
join my_other_table l on (a.id = l.id)
group by a.page, a.id, a.name)
insert overwrite directory 's3://bucket/folder/folder2/folder3/folder4/folder5/folder6/folder7/'
select page, count(distinct id) over (PARTITION BY page)
from temp
group by page;

请注意,我希望解决方案在添加步骤时起作用,因为我计划顺序添加 x步数。

最佳答案

我看到的Amazon EMR输出到Amazon S3的正常方法是在Amazon S3中将CREATE EXTERNAL TABLELOCATION一起使用。

例如:

CREATE EXTERNAL TABLE IF NOT EXISTS output_table
(gram string, year int, ratio double, increase double)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE
LOCATION 's3://my-bucket/directory';

然后,仅将 INSERT数据放入该表中:
INSERT OVERWRITE TABLE output_table
SELECT gram FROM table...

关于hadoop - 配置单元结果未保存到S3存储桶中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44447652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com