Hive终端在使用INSERT命令

时间:2018-05-03 11:21:58

标签: hadoop terminal hive insert hang

我正在尝试使用INSERT COmmand从另一个表在Hive 1.2的外部配置单元表中插入数据 -

INSERT INTO perf_tech_security_detail_extn_fltr partition 
            (created_date) 
SELECT seq_num, 
       action, 
       sde_timestamp, 
       instrmnt_id, 
       dm_lstupddt, 
       grnfthr_ind, 
       grnfthr_tl_dt, 
       grnfthr_frm_dt, 
       ftc_chge_rsn, 
       Substring (sde_timestamp, 0, 10) 
FROM   tech_security_detail_extn_fltr 
WHERE  Substring (sde_timestamp, 0, 10) = '2018-05-02'; 

但蜂巢壳挂起 -

hive> SET hive.exec.dynamic.partition=true;
hive> set hive.exec.dynamic.partition.mode=nonstrict;
hive> set hive.enforce.bucketing=true;
hive> INSERT INTO PERF_TECH_SECURITY_DETAIL_EXTN_FLTR partition (created_date) select seq_num, action, sde_timestamp, instrmnt_id, dm_lstupddt, grnfthr_ind, grnfthr_tl_dt, grnfthr_frm_dt, ftc_chge_rsn, substring (sde_timestamp,0,10) from TECH_SECURITY_DETAIL_EXTN_FLTR where substring (sde_timestamp,0,10)='2018-05-02';
Query ID = tcs_20180503215950_585152fd-ecdc-4296-85fc-d464fef44e68
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 100
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>

Hive日志如下 -

  

18-05-03 21:28:01,703 INFO [main]:log.PerfLogger   (PerfLogger.java:PerfLogEnd(148)) - 2018-05-03 21:28:01,716   错误[主要]:先生(ExecDriver.java:execute(400)) - 纱线   2018-05-03 21:28:01,758 INFO [main]:client.RMProxy   (RMProxy.java:createRMProxy(98)) - 连接到ResourceManager at   /0.0.0.0:8032 2018-05-03 21:28:01,903 INFO [main]:   fs.FSStatsPublisher(FSStatsPublisher.java:init(49)) - 创建:   hdfs:// localhost:9000 / datanode / nifi_data / perf_tech_security_detail_extn_fltr / .hive-staging_hive_2018-05-03_21-27-59_433_5606951945441160381-1 / -ext-10001 2018-05-03 21:28:01,960 INFO [main]:client。 RMProxy   (RMProxy.java:createRMProxy(98)) - 连接到ResourceManager at   /0.0.0.0:8032 2018-05-03 21:28:01,965 INFO [main]:exec.Utilities   (Utilities.java:getBaseWork(389)) - PLAN PATH =   HDFS://本地主机:9000 / TMP /蜂巢/ TCS / 576b0aa3-059d-4fb2-bed8-c975781a5fce / hive_2018-05-03_21-27-59_433_5606951945441160381-1 / -mr-10003 / 303a392c-2383-41ed-bc9d-78d37ae49f39 /map.xml   2018-05-03 21:28:01,967 INFO [main]:exec.Utilities   (Utilities.java:getBaseWork(389)) - PLAN PATH =   HDFS://本地主机:9000 / TMP /蜂巢/ TCS / 576b0aa3-059d-4fb2-bed8-c975781a5fce / hive_2018-05-03_21-27-59_433_5606951945441160381-1 / -mr-10003 / 303a392c-2383-41ed-bc9d-78d37ae49f39 /reduce.xml   2018-05-03 21:28:22,009 INFO [main]:ipc.Client   (Client.java:handleConnectionTimeout(832)) - 重试连接   server:0.0.0.0/0.0.0.0:8032。已经尝试了0次; maxRetries = 45   2018-05-03 21:28:42,027 INFO [main]:ipc.Client   (Client.java:handleConnectionTimeout(832)) - 重试连接   server:0.0.0.0/0.0.0.0:8032。已经尝试了1次; maxRetries = 45   .................................................. ........

我还尝试在未分区的表中正常插入数据,但即使这样也无效 -

INSERT INTO emp values (1 ,'ROB')

3 个答案:

答案 0 :(得分:0)

我不确定为什么没有在表名之前写表,如下所示:

INSERT INTO TABLE emp
VALUES (1 ,'ROB'), (2 ,'Shailesh');

编写适当的命令以使其起作用

答案 1 :(得分:0)

已解决

由于框架名称错误,MapReduce无法运行,因此在mapred-site.xml中编辑了属性mapreduce.framework.name

答案 2 :(得分:0)

在集群环境中,属性yarn.resourcemanager.hostname是避免此问题的关键。这对我来说很棒。

使用此命令监视YARN性能:

yarn application -listyarn node -list