Pig 下面出现错误,很大一部分是基本的语法错误,赶快检查大小写吧!
再次复习 Pig 命令的语法规则:
(1)系统关键字 不区分大小写
系统关键字挺多的,目前为止的全部关键字:
-- A |
assert, and, any, all, arrange, as, asc, AVG |
-- B |
bag, BinStorage, by, bytearray, BIGINTEGER, BIGDECIMAL |
-- C |
cache, CASE, cat, cd, chararray, cogroup, CONCAT, copyFromLocal, copyToLocal, COUNT, cp, cross |
-- D |
datetime, %declare, %default, define, dense, desc, describe, DIFF, distinct, double, du, dump |
-- E |
e, E, eval, exec, explain |
-- F |
f, F, filter, flatten, float, foreach, full |
-- G |
generate, group |
-- H |
help |
-- I |
if, illustrate, import, inner, input, int, into, is |
-- J |
join |
-- K |
kill |
-- L |
l, L, left, limit, load, long, ls |
-- M |
map, matches, MAX, MIN, mkdir, mv |
-- N |
not, null |
-- O |
onschema, or, order, outer, output |
-- P |
parallel, pig, PigDump, PigStorage, pwd |
-- Q |
quit |
-- R |
register, returns, right, rm, rmf, rollup, run |
-- S |
sample, set, ship, SIZE, split, stderr, stdin, stdout, store, stream, SUM |
-- T |
TextLoader, TOKENIZE, through, tuple |
-- U |
union, using |
-- V, W, X, Y, Z |
void |
(2)其余的,比如变量名,列名,关系名等等,都 区分大小写