我在 Hive 中有一个表 sdh,它有 100000 行。 当我执行命令时
select * from sdh
在 CLI 上,显示所有行
但是当我在直线上通过 HiveServer2 运行它时,相同的命令只是挂起
所有其他具有 1000 奇数行的表都可以通过 CLI 或直线运行。
还有其他人遇到过类似的问题吗?
我从日志中得到错误
org.apache.thrift.TApplicationException: Internal error processing FetchResults
at org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_FetchResults(TCLIService.java:489)
at org.apache.hive.service.cli.thrift.TCLIService$Client.FetchResults(TCLIService.java:476)
at org.apache.hive.jdbc.HiveQueryResultSet.next(HiveQueryResultSet.java:285)
at org.apache.hive.beeline.BufferedRows.<init>(BufferedRows.java:42)
at org.apache.hive.beeline.BeeLine.print(BeeLine.java:1541)
at org.apache.hive.beeline.Commands.execute(Commands.java:741)
at org.apache.hive.beeline.Commands.sql(Commands.java:657)
at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:763)
at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:630)
at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:363)
at org.apache.hive.beeline.BeeLine.main(BeeLine.java:346)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
错误:检索下一行时出错 (state=,code=0)
最佳答案
在直线上使用选项“--incremental=false”。否则,它会尝试同时将整个结果读入内存,如果结果对于可用内存来说太大,则会耗尽内存。
有关将此选项设置为默认选项的更多讨论在此处 - https://issues.apache.org/jira/browse/HIVE-7224
关于hadoop - Hive:对于通过 HiveServer2 具有超过 5000 行的表,select * from table 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27447503/