What is the difference between double and single quotes in pigs?
I always thought that ''
, and ""
were similar to pig
, but today I got
Unexpected character '"'
error at
register datafu-pig-1.2.1.jar
define Coalesce datafu.pig.util.Coalesce;
...
Coalesce(x,"a")
and
Coalesce(x,'a')
works great.
So what is the difference between single and double quotes?
+3
source to share
1 answer
Pig doesn't support double quotes for string literals (i.e. chararray). All chararray must be enclosed in single quotes.
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'
Link: http://chimera.labs.oreilly.com/books/1234000001811/ch04.html#scalar_types
0
source to share