1

We are trying to filter the hdfs data using Pig query.We have data enclosed within double quotes.Eg: "AAA","BBB","YYY".In which we are trying to filter YYY We tried the following ways of filter,

FILTER a BY XXX == 'YYY';
FILTER a BY XXX == '.*YYY.*';
FILTER a BY XXX == '\'\YYY\"\';

Looking forward for your help to go head.

Ahmed Salman Tahir
  • 1,783
  • 1
  • 17
  • 26

1 Answers1

2

It looks like you are trying to use regular expressions. In that case, you have a few problems. You need to use MATCHES rather than ==, you have to match the entire string, not just a substring, and when using metacharacters, you have to escape the backslash, as with any Java string: \\d to match a digit, not \d.

reo katoa
  • 5,751
  • 1
  • 18
  • 30