gpt4 book ai didi

hadoop - hive :SELECT *语句有效,但SELECT COUNT(*)不起作用

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

我在Windows Server 2008 R2上具有HDP 1.1。
我将Web登录加载到配置单元表中。
创建表语句:

create table logtable (datenonQuery string , hours string, minutes string, seconds string, TimeTaken string, Method string, UriQuery string, ProtocolStatus string) row format serde 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' with serdeproperties( "input.regex" = "(\\S+)\\t(\\d+):(\\d+):(\\d+)\\t(\\S+)\\t(\\S+)\\t(\\S+)\\t(\\S+)", "output.format.string" = "%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s") stored as textfile; 

负荷声明:
load data local inpath 'D:\Logfiles\' into table logtable;

选择声明:
Select * from logtable;

到目前为止,一切正常。

以下语句失败:
Select count(*) from logtable;

异常(exception):

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask



编辑1:

失败的作业表中的诊断信息显示以下信息:

'# of failed Map Tasks exceeded allowed limit. FailedCount: 1. LastFailedTask: task_201306251711_0010_m_000000'

最佳答案

这是与Hadoop相关的问题,而不是 hive 。 SELECT *有效而SELECT COUNT(*)不起作用的原因是后者涉及MR工作。您的数据大小是多少?

尝试通过将mapred.job.map.memory.mb属性设置为更高的值来增加映射器的堆大小。也可以尝试通过mapred.min.split.size减小拆分大小来增加映射器的数量,看看是否有任何区别。

关于hadoop - hive :SELECT *语句有效,但SELECT COUNT(*)不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17564736/

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