我一直认为''和""在pig中是一样的,但是今天我得到了
Unexpected character '"' 误判
register datafu-pig-1.2.1.jar
define Coalesce datafu.pig.util.Coalesce;
...
Coalesce(x,"a")而
Coalesce(x,'a')效果很好。
那么,单引号和双引号有什么区别呢?
发布于 2014-11-28 18:28:31
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'参考资料:types
https://stackoverflow.com/questions/27110506
复制相似问题