Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires In

  Enroll Now

Pig - Relational Operators - FOREACH

[Pig - Relational Operators - FOREACH]

FOREACH operator generates data transformations based on columns of data.

Let's say, we want to store just stock_symbol and dividends in HDFS for further processing. We can do it using the FOREACH operator. Let's do it. Launch pig, load the data, take only stock_symbol and dividends columns, and store it in a new file in HDFS. As discussed earlier, note that Pig will start the execution only when we specify dump or store command. See the content of the file to verify the result.

[Pig - FOREACH - Question]

Question - Will the code displayed on the screen, generate any reducer code?

Answer - No, as we are not doing any aggregation or sorting.

No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...