Hive:Execution Error, return code 2 和Error while compiling statement: FAILED三个问题

  • Post author:
  • Post category:其他


最近在Hive上跑数跑出了三个问题,应该都是hive查询引擎的缺陷,解决问题后照例要记录一下:



Execution Error, return code 2

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

这个是因为查询数据量太大,如果建表时存储格式为 Parquet 就会造成内存溢出。

建议:建表时使用 TEXTFILE 进行存储(STORED AS TEXTFILE) 。



Error while compiling statement: FAILED

Error while compiling statement: FAILED: SemanticException java.lang.UnsupportedOperationException: Parquet does not support date.

Parquet does not support date,英文写得比较清晰,这个是因为集群使用的 Parquet 格式不支持 date 类型。可以调整使用 String类型,又或者用 current_timestamp() 代替date()

Error while compiling statement: FAILED: IndexOutOfBoundsException Index: 1, Size: 1

另一个Error,需要在运行 SQL 前执行 set hive.optimize.ppd=false;



版权声明:本文为IceelfLuo原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。