How to write 'foreach' statement for map datatype in pig scripts?



How to write 'foreach' statement for map datatype in pig scripts?..

Answer / Ruchi Verma

"To iterate over a map data type in Pig, use the FOREACH statement with the MAP function. The syntax is as follows: FOREACH map_name GENERATED_MAP AS (key: ktype, value: vtype) {n ...n}"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache Pig Interview Questions

Explain about the execution plans of a pig script?<Br> or<br> differentiate between the logical and physical plan of an apache pig script?

1 Answers  


Explain about the execution pl of a pig script?<Br> or<br> differentiate between the logical and physical plan of an apache pig script?

1 Answers  


What are all stats classes in the org.apache.pig.tools.pigstats package?

1 Answers  


Can you join multiple fields in Apache

1 Answers  


How does pig work?

1 Answers  


How to write 'foreach' statement for map datatype in pig scripts?

1 Answers  


What are the different modes in which PIG can run and explain those?

1 Answers  


What is a relation in Pig?

1 Answers  


What are complex data types in pig?

1 Answers  


Explain hive udf function?

1 Answers  


What are the components of Pig Execution Environment?

1 Answers  


What are the different UDF’s in Pig?

1 Answers  


Categories