Find if a string is present inside another string in Pig
Asked Answered
I

1

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?

Implausibility answered 20/12, 2012 at 10:1 Comment(0)
B
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

Buggs answered 20/12, 2012 at 10:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.