Grokbase Groups Pig user May 2013
FAQ
I want to something like this

B = FOREACH A GENERATE a1, *if a2 = 0: a2=a2+1 else a2*, a3)

how to do " if a2 = 0: a2=a2+1 else a2" in PIG

(or it could be "if a2 matches < some regex>: a2+0 else a2")


I am using Pig 0.10

Search Discussions

  • Alan Gates at May 14, 2013 at 4:20 pm
    B = foreach A generate a1, (a2 == 0 ? a2 + 1 : a2) as a2, a3;

    Alan.
    On May 14, 2013, at 9:10 AM, Ashish Gupta wrote:

    I want to something like this

    B = FOREACH A GENERATE a1, *if a2 = 0: a2=a2+1 else a2*, a3)

    how to do " if a2 = 0: a2=a2+1 else a2" in PIG

    (or it could be "if a2 matches < some regex>: a2+0 else a2")


    I am using Pig 0.10

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMay 14, '13 at 4:11p
activeMay 14, '13 at 4:20p
posts2
users2
websitepig.apache.org

2 users in discussion

Ashish Gupta: 1 post Alan Gates: 1 post

People

Translate

site design / logo © 2021 Grokbase