我一直以为,''
和""
一样pig
,但是今天我得到了
Unexpected character '"'
错误
register datafu-pig-1.2.1.jar
define Coalesce datafu.pig.util.Coalesce;
...
Coalesce(x,"a")
尽管
Coalesce(x,'a')
效果很好。
那么,单引号和双引号有什么区别?
Pig不支持字符串文字(即chararray)的双引号。所有字符数组必须用单引号引起来。
A String or Chararrays are represented in interfaces by java.lang.String.
Constant chararrays are expressed as string literals with single quotes, for example, 'fred'
参考:http : //chimera.labs.oreilly.com/books/1234000001811/ch04.html#scalar_types
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句