我一直以为 '' 以及 "" 都是一样的 pig 但今天我拿到了
''
""
pig
Unexpected character '"'
上的错误
register datafu-pig-1.2.1.jardefine Coalesce datafu.pig.util.Coalesce;...Coalesce(x,"a")
register datafu-pig-1.2.1.jar
define Coalesce datafu.pig.util.Coalesce;
...
Coalesce(x,"a")
虽然
Coalesce(x,'a')
很好用。那么,单引号和双引号有什么区别呢?
omtl5h9j1#
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'
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'
reference:http://chimera.labs.oreilly.com/books/1234000001811/ch04.html#标量类型
1条答案
按热度按时间omtl5h9j1#
pig不支持字符串文本的双引号(即chararray)。所有字符必须用单引号括起来。
reference:http://chimera.labs.oreilly.com/books/1234000001811/ch04.html#标量类型