Uploaded image for project: 'DataFu'
  1. DataFu
  2. DATAFU-130

Add left outer join macro described in the DataFu guide

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0

    Description

      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:

      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));
      }
      
      

      (we would obviously want to add a test for this, too)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            eyal Eyal Allweil
            eyal Eyal Allweil
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment