hivesql语法经验

在写及测的过程中发现的,有一些可能需要进一步验证。 1 FAILED: NullPointerException null 不能用视图作为left outer join的右表 2 FAILED: UDFArgumentTypeException Only numeric or string type arguments are accepted but decimal is passed. 在cdh hive0.10中,avg的列不能是decimal类型的,apache hive0.12无此限制 3 FAILED: SemanticException [Error 10098]: Non-Partition column appears in the partition specification 建表时没有指定分区,而insert语句中指定了 4 FAILED: SemanticException [Error 10017]: Line 5:5 Both left and right aliases encountered in JOIN '***_id' 不支持非等值连接 5 FAILED: ParseException line 1:799 missing Identifier at 'group' near '' group前面缺少子表的别名 6 left semi join 的右边表的字段,不能出现在select列中 7 FAILED: SemanticException Column ***_id Found in more than One Tables/Subqueries 有一列在多个表中出现,但是没加表名前缀 8 Diagnostic Messages for this Task: Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.io.FileNotFoundException: /hadoop/tmp/nm-local-dir/usercache/hadoop/appcache/application_***/container_***/Stage-10.tar.gz/MapJoin-mapfile160--.hashtable (No such file or directory) Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.io.FileNotFoundException: /hadoop/tmp/nm-local-dir/usercache/hadoop/appcache/application_***/container_***/Stage-10.tar.gz/MapJoin-mapfile160--.hashtable (No such file or directory) apache hive0.12里面不支持create as之后的表再join三个表,只能两个;cdhhive0.10无此限制 9 cdhhive0.10不支持字段名定义为timestamp 10 增加内存,应该在新建任务的时候用hiveconf指定 如果直接用传参,再用set取的话,会导致语句无法执行 11 set语句的参数值不支持udf设定,只能是常量,或者已经设置的变量 12 left outer join 的使用,对于右表的筛选条件的设置要特别注意,如果放在where中,则left join会变为inner join,实际是先执行了left join之后,又执行筛选,这样会把左边中的部分记录删除,不符合left join对左表取全量的初衷了。需要将右表条件以子表的形式指定,或者放在on中。在oracle中也是如此,条件放在on和where中逻辑上的含义是不同的,这应该不算是hive的bug。
posted @ 2014-10-09 09:11  SARScai  阅读(500)  评论(0)    收藏  举报