Answer Posted / Sulekha
"bagtostring" in Apache Pig is a built-in function that converts a Bag into a String. A Bag represents an ordered collection of tuples, but the elements cannot be accessed individually like in other collections such as Tuple, Map, and List.nnExample usage:n`bags = FOREACH input_data GENERATE bag(col1, col2); strings = FOREACH bags GENERATE bagtostring(bags) AS string_output;`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers