One way to do it without any custom udf code is :
--- Assume A has schema my_bag:{(f1, f2, f3)};
B = FOREACH A {
X = FILTER my_bag BY f1 == 'my_element';
--- Now, count(X) will tell you if my_element is present in my_bag.
--- Example use below.
GENERATE my_bag, COUNT(X) as my_flag;
};
C = FILTER B by my_flag > 0;
Regards,
Mridul
Juan Francisco Contreras Gaitan wrote:
Hello,
Sorry for the naive question, but is there an easy way (operator or similar) to
know if an element belongs to a bag? I couldn't find it in the documentation.
Best,jfcg
_________________________________________________________________
¿Estás fuera de temporada? Entra ya en Nueva Temporada y entérate antes que
nadie de sobre famosos, moda, belleza y el look que se lleva este otoño.
http://events.es.msn.com/entretenimiento/nueva-temporada/vuelta-al-cole/