配置单元查询中的NullPointerException

时间:2013-12-24 17:59:50

标签: nullpointerexception hive having

我有一个蜂巢表,基本上是网站上的互动。我需要找到最后一次交互具有某些值的x,y和z的会话数。我得到一个NullPointerException,我无法确定原因。

(注意:名称已被更改以保护无辜者。)

SELECT COUNT(1)
FROM a_table
WHERE ds >= 'a_start_date' AND ds <= 'an_end_date'
GROUP BY session, request_started, x, y, z
HAVING MAX(array(request_started, x))[1] = 'a value'
AND MAX(array(request_started, y))[1] = 'another value' 
AND MAX(array(request_started, z))[1] IN ('value 1', 'value 2');

FAILED: Hive Internal Error: java.lang.NullPointerException(null)
java.lang.NullPointerException
  at org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc.newInstance(ExprNodeGenericFuncDesc.java:153)
  at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(TypeCheckProcFactory.java:634)
  at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:755)
  at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:89)
  at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:88)
  at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:128)
  at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:102)
  at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:156)
  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:6808)
  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genHavingPlan(SemanticAnalyzer.java:1323)
  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:5442)
  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6021)
  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6606)
  at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
  at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:340)
  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
  at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:210)
  at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:287)
  at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:517)
  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:601)
  at org.apache.hadoop.util.RunJar.main(RunJar.java:197)

0 个答案:

没有答案