2

我在 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;

除了:

失败:执行错误,从 org.apache.hadoop.hive.ql.exec.MapRedTask 返回代码 2

编辑1:

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

'# of failed Map Tasks 超出了允许的限制。FailedCount: 1. LastFailedTask: task_201306251711_0010_m_000000'

4

3 回答 3

0

这与其说是蜂巢,不如说是与 hadoop 相关的东西。SELECT * 有效而 SELECT COUNT(*) 无效的原因是后者涉及 MR 工作。你的数据大小是多少?

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

于 2013-07-10T09:22:13.980 回答
0

对我来说,这个特定的错误是一个访问问题。当我使用用户名和密码连接到数据库时解决了

于 2020-11-19T09:18:16.983 回答
0

如果输出结果集有 2 个具有相同名称的列(可能在 hive/impala 中),则 count(*) 将不起作用。

例如,查询#1 将给出结果,而查询#2 将给出错误。

解决方案 - 别名 product_code 列将解决来自查询 #2 的错误

1) 选择a.product_code, b.product_code, b.product_name, a.purchase_date, a.purchase_qty from product_fact a inner join product_dim b on (a.product_code = b.product_code)

2) Select * from ( Select a.product_code, b.product_code, b.product_name, a.purchase_date, a.purchase_qty from product_fact a inner join product_dim b on (a.product_code = b.product_code) ) as C

于 2019-05-02T19:42:02.067 回答