Author: daijy
Date: Tue May 26 22:45:41 2015
New Revision: 1681880

URL: http://svn.apache.org/r1681880
Log:
PIG-4541: Skewed full outer join does not return records if any relation is 
empty. Outer join does not return any record if left relation is empty

Modified:
    pig/branches/branch-0.15/CHANGES.txt
    
pig/branches/branch-0.15/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
    pig/branches/branch-0.15/test/e2e/pig/tests/nightly.conf

Modified: pig/branches/branch-0.15/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/pig/branches/branch-0.15/CHANGES.txt?rev=1681880&r1=1681879&r2=1681880&view=diff
==============================================================================
--- pig/branches/branch-0.15/CHANGES.txt (original)
+++ pig/branches/branch-0.15/CHANGES.txt Tue May 26 22:45:41 2015
@@ -74,6 +74,9 @@ PIG-4333: Split BigData tests into multi
  
 BUG FIXES
 
+PIG-4541: Skewed full outer join does not return records if any relation is 
empty. Outer join does not
+ return any record if left relation is empty (daijy)
+
 PIG-4564: Pig can deadlock in POPartialAgg if there is a bag (rohini via daijy)
 
 PIG-4569: Fix e2e test Rank_1 failure (rohini)

Modified: 
pig/branches/branch-0.15/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
URL: 
http://svn.apache.org/viewvc/pig/branches/branch-0.15/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java?rev=1681880&r1=1681879&r2=1681880&view=diff
==============================================================================
--- 
pig/branches/branch-0.15/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
 (original)
+++ 
pig/branches/branch-0.15/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
 Tue May 26 22:45:41 2015
@@ -61,7 +61,7 @@ public class IsFirstReduceOfKey extends
         Tuple keyTuple = tf.newTuple(1);
         keyTuple.set(0, key);
         if (!reducerMap.containsKey(keyTuple)) {
-            return false;
+            return true;
         }
         int firstReducerOfKey = reducerMap.get(keyTuple).first;
         int reduceIndex = 
UDFContext.getUDFContext().getJobConf().getInt(PigConstants.TASK_INDEX, 0);

Modified: pig/branches/branch-0.15/test/e2e/pig/tests/nightly.conf
URL: 
http://svn.apache.org/viewvc/pig/branches/branch-0.15/test/e2e/pig/tests/nightly.conf?rev=1681880&r1=1681879&r2=1681880&view=diff
==============================================================================
--- pig/branches/branch-0.15/test/e2e/pig/tests/nightly.conf (original)
+++ pig/branches/branch-0.15/test/e2e/pig/tests/nightly.conf Tue May 26 
22:45:41 2015
@@ -3083,6 +3083,19 @@ e = join a by name right outer, b by nam
 store e into ':OUTPATH:';\,
 
                         },
+                # full outer join with empty left relation
+                        {
+                        'num' => 12,
+                        'pig' => q\a = load 
':INPATH:/singlefile/studenttab10k' using PigStorage() as (name, age, gpa);
+b = filter a by name=='abc';
+e = join b by name right outer, a by name using 'skewed' parallel 8;
+store e into ':OUTPATH:';\,
+                        'verify_pig_script' => q\a = load 
':INPATH:/singlefile/studenttab10k' using PigStorage() as (name, age, gpa);
+b = foreach a generate (null, null, null, name, age, gpa);
+c = foreach b generate flatten($0);
+store c into ':OUTPATH:';\,
+
+                        },
                 ]
 
             },


Reply via email to