You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2015/05/27 00:46:31 UTC

svn commit: r1681881 - in /pig/trunk: CHANGES.txt src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java test/e2e/pig/tests/nightly.conf

Author: daijy
Date: Tue May 26 22:46:31 2015
New Revision: 1681881

URL: http://svn.apache.org/r1681881
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/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
    pig/trunk/test/e2e/pig/tests/nightly.conf

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1681881&r1=1681880&r2=1681881&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue May 26 22:46:31 2015
@@ -82,6 +82,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/trunk/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java?rev=1681881&r1=1681880&r2=1681881&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java (original)
+++ pig/trunk/src/org/apache/pig/impl/builtin/IsFirstReduceOfKey.java Tue May 26 22:46:31 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/trunk/test/e2e/pig/tests/nightly.conf
URL: http://svn.apache.org/viewvc/pig/trunk/test/e2e/pig/tests/nightly.conf?rev=1681881&r1=1681880&r2=1681881&view=diff
==============================================================================
--- pig/trunk/test/e2e/pig/tests/nightly.conf (original)
+++ pig/trunk/test/e2e/pig/tests/nightly.conf Tue May 26 22:46:31 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:';\,
+
+                        },
                 ]
 
             },