Brian Tan created PIG-2810:
------------------------------
Summary: Error parsing special character during parameter
substitution in embedded Python
Key: PIG-2810
URL: https://issues.apache.org/jira/browse/PIG-2810
Project: Pig
Issue Type: Bug
Affects Versions: 0.10.0, 0.9.2
Reporter: Brian Tan
=== 1.txt ===
a, aa
b, bb
=== 1.pig ===
a = load '1.txt' using PigStorage(',') as (x:chararray, y);
b = filter a by $PREDICATE;
dump b;
=== 1.py ===
from org.apache.pig.scripting import Pig
compiled = Pig.compileFromFile('1.pig')
bound = compiled.bind({
'PREDICATE' : r"\'a\' == x"
})
results = bound.runSingle()
The only thing that works is shown above, i.e. \'a\' == x
If you do any of the following
a == x
x == a
x == 'a'
x == \'a\'
Pig will throw syntax error.
It's getting only the part that's before ==
i.e. if you have x == a
then pig instantiates the following code:
b = filter a by x;
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira