最近在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;
本文记录了在Hive上执行数据查询时遇到的三种常见错误:ExecutionError导致的内存溢出、Parquet格式不支持date类型以及编译时的IndexOutOfBoundsException。文章提供了针对每种错误的具体解决方案,包括调整存储格式、类型转换和配置参数。
6472

被折叠的 条评论
为什么被折叠?



