运行Hive查询需要多少可用磁盘空间

时间:2015-03-10 06:23:22

标签: hadoop hive

我运行以下Hive查询

  

创建表table_llv_N_C作为select table_line_n_passed.chromosome_number,table_line_n_passed.position,table_line_c_passed.id from table_line_n_passed join table_line_c_passed on(table_line_n_passed.chromosome_number = table_line_c_passed.chromosome_number)

并出现以下错误 ...... org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row (tag=1) {"key":{"joinkey0":"12"},"value":{"_col2":"."},"alias":1} at org.apache.hadoop.hive.ql.exec.ExecReducer.reduce(ExecReducer.java:258) ... 7 more Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /tmp/hive-root/hive_2015-03-09_10-03-59_970_3646456754594156815-1/_task_tmp.-ext-10001/_tmp.000000_0 could only be replicated to 0 nodes instead of minReplication (=1). There are 2 datanode(s) running and no node(s) are excluded in this operation. ......

根本原因可能是HDFS群集中缺少磁盘空间。磁盘空间的详细信息是

hdfs dfs -df -h

Filesystem Size Used Available Use%

hdfs://x.y.ab.com:8020 159.7 G 21.9 G 110.7 G 14%

table_line_n_passed有4767409行和1.1 G大小。

同样table_line_c_passed具有4717082行和1.0 G大小。

Hive是否真的需要那么多空间(超过可用空间110 G)来处理数据。如何在运行查询之前计算可用空间需要多少。在可用空间内运行查询的任何方式。

PS:如果我在上面使用LIMIT 10000查询其运行正常。

执行计划

EXPLAIN create table table_llv_N_C as select table_line_n_passed.chromosome_number,table_line_n_passed.position,table_line_c_passed.id from table_line_n_passed join table_line_c_passed on (table_line_n_passed.chromosome_number=table_line_c_passed.chromosome_number);

摘要语法树:

(TOK_CREATETABLE (TOK_TABNAME table_llv_N_C) TOK_LIKETABLE (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME table_line_n_passed)) (TOK_TABREF (TOK_TABNAME table_line_c_passed)) (= (. (TOK_TABLE_OR_COL table_line_n_passed) chromosome_number) (. (TOK_TABLE_OR_COL table_line_c_passed) chromosome_number)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL table_line_n_passed) chromosome_number)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL table_line_n_passed) position)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL table_line_c_passed) id))))))

STAGE DEPENDENCIES:

(Stage-1 is a root stage

Stage-0 depends on stages: Stage-1

Stage-4 depends on stages: Stage-0

Stage-2 depends on stages: Stage-4

  

阶段计划:     阶段:第一阶段       地图减少         别名 - >地图运算符树:           table_line_c_passed             表扫描               别名:table_line_c_passed               减少输出操作员                 关键表达式:                       expr:chromosome_number                       type:string                 排序顺序:+                 Map-reduce分区列:                       expr:chromosome_number                       type:string                 标签:1                 值表达式:                       expr:id                       type:string           table_line_n_passed             表扫描               别名:table_line_n_passed               减少输出操作员                 关键表达式:                       expr:chromosome_number                       type:string                 排序顺序:+                 Map-reduce分区列:                       expr:chromosome_number                       type:string                 标签:0                 值表达式:                       expr:chromosome_number                       type:string                       expr:position                       type:int         减少运算符树:           加入运营商             条件图:                  内部加入0到1             条件表达式:               0 {VALUE._col0} {VALUE._col1}               1 {VALUE._col2}             handleSkewJoin:false             outputColumnNames:_col0,_col1,_col14             选择运营商               表情:                     expr:_col0                     type:string                     expr:_col1                     type:int                     expr:_col14                     type:string               outputColumnNames:_col0,_col1,_col2               文件输出操作员                 压缩:false                 GlobalTableId:1                 表:                     输入格式:org.apache.hadoop.mapred.TextInputFormat                     输出格式:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat                     名称:bright.table_llv_N_C

     

阶段:阶段0       移动操作员         文件:             hdfs目录:true             destination:hdfs://cheetah.xxx.yyyy.in:8020 / user / hive / warehouse / bright.db / table_llv_n_c

     

阶段:第四阶段         创建表运算符:           创建表             columns:chromosome_number string,position int,id string             如果不存在:false             输入格式:org.apache.hadoop.mapred.TextInputFormat             #桶:-1             输出格式:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat             name:table_llv_N_C             isExternal:false

     

阶段:第二阶段       Stats-Aggr算子

所用时间:0.146秒

1 个答案:

答案 0 :(得分:0)

转到此链接:https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties

寻找这个标签。或者在页面上搜索内存使用情况以轻松实现。

hive.map.aggr.hash.force.flush.memory.threshold

另请参阅此标记或转到第二次搜索内存使用情况

hive.mapjoin.localtask.max.memory.usage