15

I want to find if a string contains another string in Pig. I found that there is a built-in index function, but it only searches for characters not strings.

Is there any other alternative?

Sudar
  • 18,954
  • 30
  • 85
  • 131

1 Answers1

26

You can use this :

X = FILTER A BY (f1 matches '.*the_word_you're_looking_for.*');

More information here : http://pig.apache.org/docs/r0.10.0/basic.html#comparison