datafu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eyal Allweil (JIRA)" <>
Subject [jira] [Commented] (DATAFU-130) Add left outer join macro described in the DataFu guide
Date Wed, 15 Nov 2017 14:58:00 GMT


Eyal Allweil commented on DATAFU-130:

Hi [~varunu28],

Thank you for your interest! Do you have any experience with Pig?

I can't seem to assign this issue to you, but that isn't really necessary to work on it. Go
right ahead!

For setting up your environment, you should follow [this guide:|]

We haven't published instructions for how to contribute Pig macros. I'll try to write a rough
draft of a guide and email it here or put it up on our wiki.
In the meantime, you can look at [count_macros.pig|]
for an example of a macro file (though all you need to do is copy the macro in the Jira to
the macros directory), and [|]
for an example of a test. You can add your test to this file, actually.

For a guide to how to prepare a patch file, you can look [here|].

> Add left outer join macro described in the DataFu guide
> -------------------------------------------------------
>                 Key: DATAFU-130
>                 URL:
>             Project: DataFu
>          Issue Type: New Feature
>            Reporter: Eyal Allweil
>              Labels: macro, newbie
> In our [guide|], a
macro is described for making a three-way left outer join conveniently. We can add this macro
to DataFu to make it even easier to use.
> The macro's code is as follows:
> {noformat}
> DEFINE left_outer_join(relation1, key1, relation2, key2, relation3, key3) returns joined
>   cogrouped = COGROUP $relation1 BY $key1, $relation2 BY $key2, $relation3 BY $key3;
>   $joined = FOREACH cogrouped GENERATE
>     FLATTEN($relation1),
>     FLATTEN(EmptyBagToNullFields($relation2)),
>     FLATTEN(EmptyBagToNullFields($relation3));
> }
> {noformat}
> (we would obviously want to add a test for this, too)

This message was sent by Atlassian JIRA

View raw message