Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-2.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-2.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-2.gld 
(original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-2.gld 
Tue Jan 27 02:27:45 2015
@@ -4,16 +4,16 @@
 #--------------------------------------------------
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
-Tez vertex scope-106   ->      Tez vertex scope-119,Tez vertex scope-113,Tez 
vertex scope-126,Tez vertex scope-158,Tez vertex scope-148,Tez vertex 
scope-167,Tez vertex group scope-208,
-Tez vertex scope-167   ->      Tez vertex group scope-208,
-Tez vertex group scope-208
+Tez vertex scope-106   ->      Tez vertex scope-113,Tez vertex scope-119,Tez 
vertex scope-126,Tez vertex scope-148,Tez vertex scope-158,Tez vertex 
scope-167,Tez vertex group scope-208,
 Tez vertex scope-113
-Tez vertex scope-148   ->      Tez vertex scope-158,
-Tez vertex scope-158   ->      Tez vertex scope-160,
-Tez vertex scope-160
 Tez vertex scope-119   ->      Tez vertex scope-126,Tez vertex scope-129,
 Tez vertex scope-126
 Tez vertex scope-129
+Tez vertex scope-148   ->      Tez vertex scope-158,
+Tez vertex scope-158   ->      Tez vertex scope-160,
+Tez vertex scope-160
+Tez vertex scope-167   ->      Tez vertex group scope-208,
+Tez vertex group scope-208
 
 Tez vertex scope-106
 # Plan on vertex
@@ -112,19 +112,6 @@ Tez vertex scope-106
     |   |---Project[bytearray][1] - scope-4
     |
     |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-0
-Tez vertex scope-167
-# Plan on vertex
-f1: Split - scope-202
-|   |
-|   f1: Store(file:///tmp/output/f1:org.apache.pig.builtin.PigStorage) - 
scope-99
-|   |
-|   f2: Store(file:///tmp/output/f2:org.apache.pig.builtin.PigStorage) - 
scope-210
-|
-|---f1: Limit - scope-169
-    |
-    |---POValueInputTez - scope-168    <-       scope-106
-Tez vertex group scope-208     <-       [scope-106, scope-167] ->       null
-# No plan on vertex group
 Tez vertex scope-113
 # Plan on vertex
 b1: Split - scope-201
@@ -144,37 +131,6 @@ b1: Split - scope-201
 |       |       |---Project[bag][1] - scope-28
 |
 |---b1: Package(Packager)[tuple]{int} - scope-17
-Tez vertex scope-148
-# Plan on vertex
-POValueOutputTez - scope-157   ->       [scope-158]
-|
-|---New For Each(false)[tuple] - scope-156
-    |   |
-    |   
POUserFunc(org.apache.pig.backend.hadoop.executionengine.tez.plan.udf.FindQuantilesTez)[tuple]
 - scope-155
-    |   |
-    |   |---Project[tuple][*] - scope-154
-    |
-    |---New For Each(false,false)[tuple] - scope-153
-        |   |
-        |   Constant(-1) - scope-152
-        |   |
-        |   Project[bag][1] - scope-150
-        |
-        |---Package(Packager)[tuple]{bytearray} - scope-149
-Tez vertex scope-158
-# Plan on vertex
-POIdentityInOutTez - scope-159 <-       scope-106      ->       scope-160
-|   |
-|   Project[int][0] - scope-88
-Tez vertex scope-160
-# Plan on vertex
-e1: Store(file:///tmp/output/e1:org.apache.pig.builtin.PigStorage) - scope-90
-|
-|---New For Each(true)[tuple] - scope-163
-    |   |
-    |   Project[bag][1] - scope-162
-    |
-    |---Package(LitePackager)[tuple]{int} - scope-161
 Tez vertex scope-119
 # Plan on vertex
 c: Split - scope-205
@@ -246,3 +202,47 @@ c3: Store(file:///tmp/output/c1:org.apac
     |   |---Project[bag][1] - scope-190
     |
     |---c2: Package(CombinerPackager)[tuple]{int} - scope-58
+Tez vertex scope-148
+# Plan on vertex
+POValueOutputTez - scope-157   ->       [scope-158]
+|
+|---New For Each(false)[tuple] - scope-156
+    |   |
+    |   
POUserFunc(org.apache.pig.backend.hadoop.executionengine.tez.plan.udf.FindQuantilesTez)[tuple]
 - scope-155
+    |   |
+    |   |---Project[tuple][*] - scope-154
+    |
+    |---New For Each(false,false)[tuple] - scope-153
+        |   |
+        |   Constant(-1) - scope-152
+        |   |
+        |   Project[bag][1] - scope-150
+        |
+        |---Package(Packager)[tuple]{bytearray} - scope-149
+Tez vertex scope-158
+# Plan on vertex
+POIdentityInOutTez - scope-159 <-       scope-106      ->       scope-160
+|   |
+|   Project[int][0] - scope-88
+Tez vertex scope-160
+# Plan on vertex
+e1: Store(file:///tmp/output/e1:org.apache.pig.builtin.PigStorage) - scope-90
+|
+|---New For Each(true)[tuple] - scope-163
+    |   |
+    |   Project[bag][1] - scope-162
+    |
+    |---Package(LitePackager)[tuple]{int} - scope-161
+Tez vertex scope-167
+# Plan on vertex
+f1: Split - scope-202
+|   |
+|   f1: Store(file:///tmp/output/f1:org.apache.pig.builtin.PigStorage) - 
scope-99
+|   |
+|   f2: Store(file:///tmp/output/f2:org.apache.pig.builtin.PigStorage) - 
scope-210
+|
+|---f1: Limit - scope-169
+    |
+    |---POValueInputTez - scope-168    <-       scope-106
+Tez vertex group scope-208     <-       [scope-106, scope-167] ->       null
+# No plan on vertex group

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-3.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-3.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-3.gld 
(original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-3.gld 
Tue Jan 27 02:27:45 2015
@@ -5,8 +5,8 @@
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
 Tez vertex scope-38    ->      Tez vertex scope-42,Tez vertex scope-45,
-Tez vertex scope-45
 Tez vertex scope-42
+Tez vertex scope-45
 
 Tez vertex scope-38
 # Plan on vertex
@@ -55,33 +55,6 @@ a: Split - scope-86
     |   |---Project[bytearray][1] - scope-4
     |
     |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-0
-Tez vertex scope-45
-# Combine plan on edge <scope-38>
-c: Local Rearrange[tuple]{tuple}(false) - scope-82     ->       scope-45
-|   |
-|   Project[tuple][0] - scope-85
-|
-|---c: New For Each(false,false)[bag] - scope-70
-    |   |
-    |   Project[tuple][0] - scope-71
-    |   |
-    |   POUserFunc(org.apache.pig.builtin.COUNT$Intermediate)[tuple] - scope-72
-    |   |
-    |   |---Project[bag][1] - scope-73
-    |
-    |---c: Package(CombinerPackager)[tuple]{tuple} - scope-76
-# Plan on vertex
-c: Store(file:///tmp/output/c:org.apache.pig.builtin.PigStorage) - scope-37
-|
-|---c: New For Each(false,false)[bag] - scope-36
-    |   |
-    |   Project[tuple][0] - scope-30
-    |   |
-    |   POUserFunc(org.apache.pig.builtin.COUNT$Final)[long] - scope-34
-    |   |
-    |   |---Project[bag][1] - scope-74
-    |
-    |---c: Package(CombinerPackager)[tuple]{tuple} - scope-26
 Tez vertex scope-42
 # Combine plan on edge <scope-38>
 b: Local Rearrange[tuple]{int}(false) - scope-62       ->       scope-42
@@ -109,3 +82,30 @@ b: Store(file:///tmp/output/b:org.apache
     |   |---Project[bag][1] - scope-55
     |
     |---b: Package(CombinerPackager)[tuple]{int} - scope-12
+Tez vertex scope-45
+# Combine plan on edge <scope-38>
+c: Local Rearrange[tuple]{tuple}(false) - scope-82     ->       scope-45
+|   |
+|   Project[tuple][0] - scope-85
+|
+|---c: New For Each(false,false)[bag] - scope-70
+    |   |
+    |   Project[tuple][0] - scope-71
+    |   |
+    |   POUserFunc(org.apache.pig.builtin.COUNT$Intermediate)[tuple] - scope-72
+    |   |
+    |   |---Project[bag][1] - scope-73
+    |
+    |---c: Package(CombinerPackager)[tuple]{tuple} - scope-76
+# Plan on vertex
+c: Store(file:///tmp/output/c:org.apache.pig.builtin.PigStorage) - scope-37
+|
+|---c: New For Each(false,false)[bag] - scope-36
+    |   |
+    |   Project[tuple][0] - scope-30
+    |   |
+    |   POUserFunc(org.apache.pig.builtin.COUNT$Final)[long] - scope-34
+    |   |
+    |   |---Project[bag][1] - scope-74
+    |
+    |---c: Package(CombinerPackager)[tuple]{tuple} - scope-26

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-4-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-4-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-4-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-4-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -7,9 +7,9 @@
 Tez vertex scope-117   ->      Tez vertex scope-119,
 Tez vertex scope-118   ->      Tez vertex scope-119,
 Tez vertex scope-119   ->      Tez vertex scope-121,Tez vertex scope-123,Tez 
vertex scope-125,
+Tez vertex scope-121
 Tez vertex scope-123
 Tez vertex scope-125
-Tez vertex scope-121
 
 Tez vertex scope-117
 # Plan on vertex
@@ -47,7 +47,7 @@ c: Local Rearrange[tuple]{int}(false) -
     |---b: Load(file:///tmp/input2:org.apache.pig.builtin.PigStorage) - 
scope-72
 Tez vertex scope-119
 # Plan on vertex
-POValueOutputTez - scope-120   ->       [scope-123, scope-125, scope-121]
+POValueOutputTez - scope-120   ->       [scope-121, scope-123, scope-125]
 |
 |---c: New For Each(true,true)[tuple] - scope-90
     |   |
@@ -56,6 +56,11 @@ POValueOutputTez - scope-120 ->       [scope-
     |   Project[bag][2] - scope-89
     |
     |---c: Package(Packager)[tuple]{int} - scope-83
+Tez vertex scope-121
+# Plan on vertex
+c: Store(file:///tmp/output/c:org.apache.pig.builtin.PigStorage) - scope-94
+|
+|---POValueInputTez - scope-122        <-       scope-119
 Tez vertex scope-123
 # Plan on vertex
 d: Store(file:///tmp/output/d:org.apache.pig.builtin.PigStorage) - scope-104
@@ -84,8 +89,3 @@ e: Store(file:///tmp/output/e:org.apache
     |   Project[int][3] - scope-113
     |
     |---POValueInputTez - scope-126    <-       scope-119
-Tez vertex scope-121
-# Plan on vertex
-c: Store(file:///tmp/output/c:org.apache.pig.builtin.PigStorage) - scope-94
-|
-|---POValueInputTez - scope-122        <-       scope-119

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-5-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-5-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-5-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-MQ-5-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -6,11 +6,11 @@
 #--------------------------------------------------
 Tez vertex scope-102   ->      Tez vertex scope-103,
 Tez vertex scope-103   ->      Tez vertex scope-105,Tez vertex scope-107,Tez 
vertex scope-109,
+Tez vertex scope-105
+Tez vertex scope-107
 Tez vertex scope-109   ->      Tez vertex scope-112,Tez vertex scope-114,
-Tez vertex scope-114
 Tez vertex scope-112
-Tez vertex scope-107
-Tez vertex scope-105
+Tez vertex scope-114
 
 Tez vertex scope-102
 # Plan on vertex
@@ -31,34 +31,14 @@ b: Local Rearrange[tuple]{int}(false) -
     |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-59
 Tez vertex scope-103
 # Plan on vertex
-POValueOutputTez - scope-104   ->       [scope-107, scope-109, scope-105]
+POValueOutputTez - scope-104   ->       [scope-105, scope-107, scope-109]
 |
 |---b: Package(Packager)[tuple]{int} - scope-68
-Tez vertex scope-109
-# Plan on vertex
-POValueOutputTez - scope-111   ->       [scope-114, scope-112]
-|
-|---d: New For Each(true)[bag] - scope-89
-    |   |
-    |   Project[bag][1] - scope-87
-    |
-    |---POValueInputTez - scope-110    <-       scope-103
-Tez vertex scope-114
-# Plan on vertex
-e: Store(file:///tmp/output/e:org.apache.pig.builtin.PigStorage) - scope-101
-|
-|---e: New For Each(false,false)[bag] - scope-100
-    |   |
-    |   Project[int][0] - scope-96
-    |   |
-    |   Project[int][1] - scope-98
-    |
-    |---POValueInputTez - scope-115    <-       scope-109
-Tez vertex scope-112
+Tez vertex scope-105
 # Plan on vertex
-d: Store(file:///tmp/output/d:org.apache.pig.builtin.PigStorage) - scope-93
+b: Store(file:///tmp/output/b:org.apache.pig.builtin.PigStorage) - scope-74
 |
-|---POValueInputTez - scope-113        <-       scope-109
+|---POValueInputTez - scope-106        <-       scope-103
 Tez vertex scope-107
 # Plan on vertex
 c: Store(file:///tmp/output/c:org.apache.pig.builtin.PigStorage) - scope-84
@@ -74,8 +54,28 @@ c: Store(file:///tmp/output/c:org.apache
     |   |---Project[bag][1] - scope-80
     |
     |---POValueInputTez - scope-108    <-       scope-103
-Tez vertex scope-105
+Tez vertex scope-109
 # Plan on vertex
-b: Store(file:///tmp/output/b:org.apache.pig.builtin.PigStorage) - scope-74
+POValueOutputTez - scope-111   ->       [scope-112, scope-114]
 |
-|---POValueInputTez - scope-106        <-       scope-103
+|---d: New For Each(true)[bag] - scope-89
+    |   |
+    |   Project[bag][1] - scope-87
+    |
+    |---POValueInputTez - scope-110    <-       scope-103
+Tez vertex scope-112
+# Plan on vertex
+d: Store(file:///tmp/output/d:org.apache.pig.builtin.PigStorage) - scope-93
+|
+|---POValueInputTez - scope-113        <-       scope-109
+Tez vertex scope-114
+# Plan on vertex
+e: Store(file:///tmp/output/e:org.apache.pig.builtin.PigStorage) - scope-101
+|
+|---e: New For Each(false,false)[bag] - scope-100
+    |   |
+    |   Project[int][0] - scope-96
+    |   |
+    |   Project[int][1] - scope-98
+    |
+    |---POValueInputTez - scope-115    <-       scope-109

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Order-1.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Order-1.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Order-1.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Order-1.gld
 Tue Jan 27 02:27:45 2015
@@ -4,7 +4,7 @@
 #--------------------------------------------------
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
-Tez vertex scope-11    ->      Tez vertex scope-30,Tez vertex scope-20,
+Tez vertex scope-11    ->      Tez vertex scope-20,Tez vertex scope-30,
 Tez vertex scope-20    ->      Tez vertex scope-30,
 Tez vertex scope-30    ->      Tez vertex scope-32,
 Tez vertex scope-32

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-1.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-1.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-1.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-1.gld
 Tue Jan 27 02:27:45 2015
@@ -4,7 +4,7 @@
 #--------------------------------------------------
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
-Tez vertex scope-11    ->      Tez vertex scope-14,Tez vertex scope-12,
+Tez vertex scope-11    ->      Tez vertex scope-12,Tez vertex scope-14,
 Tez vertex scope-12    ->      Tez vertex scope-14,
 Tez vertex scope-14
 

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-2.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-2.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-2.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Rank-2.gld
 Tue Jan 27 02:27:45 2015
@@ -5,10 +5,10 @@
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
 Tez vertex scope-23    ->      Tez vertex scope-24,
-Tez vertex scope-24    ->      Tez vertex scope-43,Tez vertex scope-33,
+Tez vertex scope-24    ->      Tez vertex scope-33,Tez vertex scope-43,
 Tez vertex scope-33    ->      Tez vertex scope-43,
 Tez vertex scope-43    ->      Tez vertex scope-45,
-Tez vertex scope-45    ->      Tez vertex scope-51,Tez vertex scope-49,
+Tez vertex scope-45    ->      Tez vertex scope-49,Tez vertex scope-51,
 Tez vertex scope-49    ->      Tez vertex scope-51,
 Tez vertex scope-51
 

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-SkewJoin-1.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-SkewJoin-1.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-SkewJoin-1.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-SkewJoin-1.gld
 Tue Jan 27 02:27:45 2015
@@ -4,8 +4,8 @@
 #--------------------------------------------------
 # TEZ DAG plan: pig-0_scope-0
 #--------------------------------------------------
-Tez vertex scope-27    ->      Tez vertex scope-46,Tez vertex scope-36,
-Tez vertex scope-36    ->      Tez vertex scope-46,Tez vertex scope-28,
+Tez vertex scope-27    ->      Tez vertex scope-36,Tez vertex scope-46,
+Tez vertex scope-36    ->      Tez vertex scope-28,Tez vertex scope-46,
 Tez vertex scope-46    ->      Tez vertex scope-50,
 Tez vertex scope-28    ->      Tez vertex scope-50,
 Tez vertex scope-50
@@ -43,7 +43,7 @@ Local Rearrange[tuple]{tuple}(false) - s
                 |---a: 
Load(file:///tmp/input1:org.apache.pig.builtin.PigStorage) - scope-0
 Tez vertex scope-36
 # Plan on vertex
-POValueOutputTez - scope-45    ->       [scope-46, scope-28]
+POValueOutputTez - scope-45    ->       [scope-28, scope-46]
 |
 |---New For Each(false)[tuple] - scope-44
     |   |

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-1-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-1-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-1-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-1-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -42,4 +42,4 @@ Tez vertex scope-47
 # Plan on vertex
 c: Store(file:///tmp/output:org.apache.pig.builtin.PigStorage) - scope-44
 |
-|---POShuffledValueInputTez - scope-48 <-       [scope-46, scope-45]
+|---POShuffledValueInputTez - scope-48 <-       [scope-45, scope-46]

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-10-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-10-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-10-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-10-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -67,7 +67,7 @@ f: Local Rearrange[tuple]{int}(false) -
 |   |
 |   Project[int][0] - scope-29
 |
-|---POShuffledValueInputTez - scope-39 <-       [scope-37, scope-33]
+|---POShuffledValueInputTez - scope-39 <-       [scope-33, scope-37]
 Tez vertex scope-42
 # Plan on vertex
 f: Store(file:///tmp/output:org.apache.pig.builtin.PigStorage) - scope-30

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -57,7 +57,7 @@ d: Local Rearrange[tuple]{int}(false) -
     |
     |---Pre Combiner Local Rearrange[tuple]{Unknown} - scope-123
         |
-        |---POShuffledValueInputTez - scope-104        <-       [scope-102, 
scope-101]
+        |---POShuffledValueInputTez - scope-104        <-       [scope-101, 
scope-102]
 Tez vertex scope-107
 # Combine plan on edge <scope-103>
 d: Local Rearrange[tuple]{int}(false) - scope-124      ->       scope-107

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-2.gld
 Tue Jan 27 02:27:45 2015
@@ -11,19 +11,19 @@ Tez vertex scope-35
 
 Tez vertex scope-29
 # Plan on vertex
-d: Local Rearrange[tuple]{int}(false) - scope-56       ->       scope-35
+d: Local Rearrange[tuple]{int}(false) - scope-61       ->       scope-35
 |   |
-|   Project[int][0] - scope-57
+|   Project[int][0] - scope-62
 |
-|---e: New For Each(false,false)[bag] - scope-62
+|---e: New For Each(false,false)[bag] - scope-60
     |   |
-    |   Project[int][0] - scope-58
+    |   Project[int][0] - scope-56
     |   |
-    |   POUserFunc(org.apache.pig.builtin.AlgebraicMathBase$Initial)[tuple] - 
scope-59
+    |   POUserFunc(org.apache.pig.builtin.AlgebraicMathBase$Initial)[tuple] - 
scope-57
     |   |
-    |   |---Project[bag][1] - scope-60
+    |   |---Project[bag][1] - scope-58
     |       |
-    |       |---Project[bag][1] - scope-61
+    |       |---Project[bag][1] - scope-59
     |
     |---Pre Combiner Local Rearrange[tuple]{Unknown} - scope-63
         |
@@ -40,19 +40,19 @@ d: Local Rearrange[tuple]{int}(false) -
             |---a: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - 
scope-0
 Tez vertex scope-30
 # Plan on vertex
-d: Local Rearrange[tuple]{int}(false) - scope-64       ->       scope-35
+d: Local Rearrange[tuple]{int}(false) - scope-69       ->       scope-35
 |   |
-|   Project[int][0] - scope-65
+|   Project[int][0] - scope-70
 |
-|---e: New For Each(false,false)[bag] - scope-70
+|---e: New For Each(false,false)[bag] - scope-68
     |   |
-    |   Project[int][0] - scope-66
+    |   Project[int][0] - scope-64
     |   |
-    |   POUserFunc(org.apache.pig.builtin.AlgebraicMathBase$Initial)[tuple] - 
scope-67
+    |   POUserFunc(org.apache.pig.builtin.AlgebraicMathBase$Initial)[tuple] - 
scope-65
     |   |
-    |   |---Project[bag][1] - scope-68
+    |   |---Project[bag][1] - scope-66
     |       |
-    |       |---Project[bag][1] - scope-69
+    |       |---Project[bag][1] - scope-67
     |
     |---Pre Combiner Local Rearrange[tuple]{Unknown} - scope-71
         |
@@ -70,7 +70,7 @@ d: Local Rearrange[tuple]{int}(false) -
 Tez vertex group scope-55      <-       [scope-29, scope-30]   ->       
scope-35
 # No plan on vertex group
 Tez vertex scope-35
-# Combine plan on edge <scope-30>
+# Combine plan on edge <scope-29>
 d: Local Rearrange[tuple]{int}(false) - scope-52       ->       scope-35
 |   |
 |   Project[int][0] - scope-54
@@ -84,7 +84,7 @@ d: Local Rearrange[tuple]{int}(false) -
     |   |---Project[bag][1] - scope-44
     |
     |---d: Package(CombinerPackager)[tuple]{int} - scope-47
-# Combine plan on edge <scope-29>
+# Combine plan on edge <scope-30>
 d: Local Rearrange[tuple]{int}(false) - scope-52       ->       scope-35
 |   |
 |   Project[int][0] - scope-54

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-4-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-4-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-4-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-4-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -66,4 +66,4 @@ e: Store(file:///tmp/output:org.apache.p
     |   |
     |   Project[int][0] - scope-67
     |
-    |---POShuffledValueInputTez - scope-78     <-       [scope-76, scope-75]
+    |---POShuffledValueInputTez - scope-78     <-       [scope-75, scope-76]

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -6,8 +6,8 @@
 #--------------------------------------------------
 Tez vertex scope-114   ->      Tez vertex scope-116,
 Tez vertex scope-115   ->      Tez vertex scope-116,
-Tez vertex scope-116   ->      Tez vertex scope-138,Tez vertex scope-128,
-Tez vertex scope-128   ->      Tez vertex scope-138,Tez vertex scope-120,
+Tez vertex scope-116   ->      Tez vertex scope-128,Tez vertex scope-138,
+Tez vertex scope-128   ->      Tez vertex scope-120,Tez vertex scope-138,
 Tez vertex scope-138   ->      Tez vertex scope-142,
 Tez vertex scope-120   ->      Tez vertex scope-142,
 Tez vertex scope-142
@@ -65,7 +65,7 @@ Local Rearrange[tuple]{tuple}(false) - s
             |---POShuffledValueInputTez - scope-117    <-       [scope-114, 
scope-115]
 Tez vertex scope-128
 # Plan on vertex
-POValueOutputTez - scope-137   ->       [scope-138, scope-120]
+POValueOutputTez - scope-137   ->       [scope-120, scope-138]
 |
 |---New For Each(false)[tuple] - scope-136
     |   |

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-6.gld
 Tue Jan 27 02:27:45 2015
@@ -7,7 +7,7 @@
 Tez vertex scope-29    ->      Tez vertex group scope-63,Tez vertex group 
scope-64,
 Tez vertex scope-30    ->      Tez vertex group scope-63,Tez vertex group 
scope-64,
 Tez vertex group scope-64      ->      Tez vertex scope-43,
-Tez vertex scope-43    ->      Tez vertex scope-53,Tez vertex scope-35,
+Tez vertex scope-43    ->      Tez vertex scope-35,Tez vertex scope-53,
 Tez vertex group scope-63      ->      Tez vertex scope-53,
 Tez vertex scope-53    ->      Tez vertex scope-57,
 Tez vertex scope-35    ->      Tez vertex scope-57,
@@ -23,9 +23,9 @@ Local Rearrange[tuple]{tuple}(false) - s
     |   |
     |   Project[int][0] - scope-71
     |   |
-    |   POUserFunc(org.apache.pig.impl.builtin.GetMemNumRows)[tuple] - scope-72
+    |   POUserFunc(org.apache.pig.impl.builtin.GetMemNumRows)[tuple] - scope-73
     |   |
-    |   |---Project[tuple][*] - scope-73
+    |   |---Project[tuple][*] - scope-72
     |
     |---PoissonSample - scope-70
         |
@@ -54,9 +54,9 @@ Local Rearrange[tuple]{tuple}(false) - s
     |   |
     |   Project[int][0] - scope-81
     |   |
-    |   POUserFunc(org.apache.pig.impl.builtin.GetMemNumRows)[tuple] - scope-82
+    |   POUserFunc(org.apache.pig.impl.builtin.GetMemNumRows)[tuple] - scope-83
     |   |
-    |   |---Project[tuple][*] - scope-83
+    |   |---Project[tuple][*] - scope-82
     |
     |---PoissonSample - scope-80
         |
@@ -79,7 +79,7 @@ Tez vertex group scope-64     <-       [scope-29,
 # No plan on vertex group
 Tez vertex scope-43
 # Plan on vertex
-POValueOutputTez - scope-52    ->       [scope-53, scope-35]
+POValueOutputTez - scope-52    ->       [scope-35, scope-53]
 |
 |---New For Each(false)[tuple] - scope-51
     |   |

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -6,7 +6,7 @@
 #--------------------------------------------------
 Tez vertex scope-93    ->      Tez vertex scope-95,
 Tez vertex scope-94    ->      Tez vertex scope-95,
-Tez vertex scope-95    ->      Tez vertex scope-117,Tez vertex scope-107,
+Tez vertex scope-95    ->      Tez vertex scope-107,Tez vertex scope-117,
 Tez vertex scope-107   ->      Tez vertex scope-117,
 Tez vertex scope-117   ->      Tez vertex scope-119,
 Tez vertex scope-119

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-7.gld
 Tue Jan 27 02:27:45 2015
@@ -14,9 +14,9 @@ Tez vertex scope-46
 
 Tez vertex scope-20
 # Plan on vertex
-Local Rearrange[tuple]{tuple}(false) - scope-54        ->       scope-34
+Local Rearrange[tuple]{tuple}(false) - scope-55        ->       scope-34
 |   |
-|   Constant(DummyVal) - scope-55
+|   Constant(DummyVal) - scope-56
 |
 |---New For Each(false,true)[tuple] - scope-62
     |   |
@@ -26,11 +26,11 @@ Local Rearrange[tuple]{tuple}(false) - s
     |   |
     |   |---Project[tuple][*] - scope-60
     |
-    |---ReservoirSample - scope-53
+    |---ReservoirSample - scope-58
         |
-        |---d: Local Rearrange[tuple]{int}(false) - scope-57   ->       
scope-44
+        |---d: Local Rearrange[tuple]{int}(false) - scope-53   ->       
scope-44
             |   |
-            |   Project[int][0] - scope-58
+            |   Project[int][0] - scope-54
             |
             |---a: New For Each(false,false)[bag] - scope-7
                 |   |
@@ -45,9 +45,9 @@ Local Rearrange[tuple]{tuple}(false) - s
                 |---a: 
Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-0
 Tez vertex scope-21
 # Plan on vertex
-Local Rearrange[tuple]{tuple}(false) - scope-64        ->       scope-34
+Local Rearrange[tuple]{tuple}(false) - scope-65        ->       scope-34
 |   |
-|   Constant(DummyVal) - scope-65
+|   Constant(DummyVal) - scope-66
 |
 |---New For Each(false,true)[tuple] - scope-72
     |   |
@@ -57,11 +57,11 @@ Local Rearrange[tuple]{tuple}(false) - s
     |   |
     |   |---Project[tuple][*] - scope-70
     |
-    |---ReservoirSample - scope-63
+    |---ReservoirSample - scope-68
         |
-        |---d: Local Rearrange[tuple]{int}(false) - scope-67   ->       
scope-44
+        |---d: Local Rearrange[tuple]{int}(false) - scope-63   ->       
scope-44
             |   |
-            |   Project[int][0] - scope-68
+            |   Project[int][0] - scope-64
             |
             |---c: New For Each(false,false)[bag] - scope-15
                 |   |

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -68,4 +68,4 @@ d: Store(file:///tmp/output:org.apache.p
 |
 |---d: Limit - scope-58
     |
-    |---POShuffledValueInputTez - scope-71     <-       [scope-67, scope-62]
+    |---POShuffledValueInputTez - scope-71     <-       [scope-62, scope-67]

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-8.gld
 Tue Jan 27 02:27:45 2015
@@ -68,4 +68,4 @@ d: Store(file:///tmp/output:org.apache.p
 |
 |---d: Limit - scope-21
     |
-    |---POShuffledValueInputTez - scope-34     <-       [scope-30, scope-25]
+    |---POShuffledValueInputTez - scope-34     <-       [scope-25, scope-30]

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9-OPTOFF.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9-OPTOFF.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9-OPTOFF.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9-OPTOFF.gld
 Tue Jan 27 02:27:45 2015
@@ -86,4 +86,4 @@ Tez vertex scope-109
 |       |       |
 |       |       |---Constant(500) - scope-98
 |
-|---POShuffledValueInputTez - scope-110        <-       [scope-108, scope-102]
+|---POShuffledValueInputTez - scope-110        <-       [scope-102, scope-108]

Modified: 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9.gld
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9.gld?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9.gld
 (original)
+++ 
pig/branches/spark/test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-Union-9.gld
 Tue Jan 27 02:27:45 2015
@@ -6,8 +6,8 @@
 #--------------------------------------------------
 Tez vertex scope-40    ->      Tez vertex group scope-58,Tez vertex group 
scope-59,
 Tez vertex scope-46    ->      Tez vertex group scope-58,Tez vertex group 
scope-59,
-Tez vertex group scope-59
 Tez vertex group scope-58
+Tez vertex group scope-59
 
 Tez vertex scope-40
 # Plan on vertex
@@ -105,7 +105,7 @@ Tez vertex scope-46
     |   |---Project[bytearray][0] - scope-23
     |
     |---b: Load(file:///tmp/input:org.apache.pig.builtin.PigStorage) - scope-19
-Tez vertex group scope-59      <-       [scope-40, scope-46]   ->       null
-# No plan on vertex group
 Tez vertex group scope-58      <-       [scope-40, scope-46]   ->       null
 # No plan on vertex group
+Tez vertex group scope-59      <-       [scope-40, scope-46]   ->       null
+# No plan on vertex group

Modified: pig/branches/spark/test/org/apache/pig/test/pigunit/TestPigTest.java
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/pigunit/TestPigTest.java?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/test/pigunit/TestPigTest.java 
(original)
+++ pig/branches/spark/test/org/apache/pig/test/pigunit/TestPigTest.java Tue 
Jan 27 02:27:45 2015
@@ -17,11 +17,17 @@ package org.apache.pig.test.pigunit;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.ComparisonFailure;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
@@ -432,4 +438,170 @@ public class TestPigTest {
         scriptFile.delete();
         bootupFile.delete();
     }
+
+    @Test
+    public void testMockedAliasWithDefaultDelimiter() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args, null, null);
+
+        String[] mockData = {
+                "Apache\t99",
+                "Pig\t42",
+                "GitHub\t107",
+                "Google\t404"
+        };
+        test.mockAlias("queries_ordered", mockData,"(query: chararray,count: 
int)");
+
+        String[] expectedOutput = {
+                "(Apache,99)",
+                "(Pig,42)",
+                "(GitHub,107)"
+        };
+        test.assertOutput(expectedOutput);
+    }
+
+    @Test
+    public void testMockedAliasWithDifferentDelimiter() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args, null, null);
+
+        String[] mockData = {
+                "Apache,99",
+                "Pig,42",
+                "GitHub,107",
+                "Google,404"
+        };
+        test.mockAlias("queries_ordered", mockData,"(query: chararray,count: 
int)", ",");
+
+        String[] expectedOutput = {
+                "(Apache,99)",
+                "(Pig,42)",
+                "(GitHub,107)"
+        };
+        test.assertOutput(expectedOutput);
+    }
+
+    @Test
+    public void testAliasSchemaMap() throws Exception {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args, null, null);
+        
+        final Map<String, String> expected = new HashMap<String, String>();
+        expected.put("data", "(query: chararray,count: int)");
+        expected.put("queries_group", "(group: chararray,data: {(query: 
chararray,count: int)})");
+        expected.put("queries_sum", "(query: chararray,count: long)");
+        expected.put("queries_ordered", "(query: chararray,count: long)");
+        expected.put("queries_limit", "(query: chararray,count: long)");
+        Map<String, String> map = test.getAliasToSchemaMap();
+        
+        assertEquals(expected, map);
+    }
+    
+    @Test
+    public void testAnyOrderOutput() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args);
+
+        String[] reorderedExpectedOutput = {
+                "(twitter,7)",
+                "(yahoo,25)",
+                "(facebook,15)"
+        };
+        test.assertOutputAnyOrder(reorderedExpectedOutput);
+    }
+    
+    @Test
+    public void testAnyOrderOutputForAlias() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args);
+
+        String[] reorderedExpectedOutput = {
+                "(twitter,7)",
+                "(yahoo,25)",
+                "(facebook,15)"
+        };
+        test.assertOutputAnyOrder("queries_limit", reorderedExpectedOutput);
+    }
+    
+    @Test
+    public void testSpecificOrderOutput() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args);
+
+        String[] reorderedExpectedOutput = {
+                "(twitter,7)",
+                "(yahoo,25)",
+                "(facebook,15)"
+        };
+        
+        try {
+            test.assertOutput(reorderedExpectedOutput);
+            fail("assertOutput should fail when the records are unordered.");
+        }
+        catch(ComparisonFailure e) {
+            //Test passes
+        }
+    }
+    
+    @Test
+    public void testSpecificOrderOutputForAlias() throws Exception  {
+        String[] args = {
+                "n=3",
+                "reducers=1",
+                "input=top_queries_input_data.txt",
+                "output=top_3_queries",
+        };
+
+        test = new PigTest(PIG_SCRIPT, args);
+
+        String[] reorderedExpectedOutput = {
+                "(twitter,7)",
+                "(yahoo,25)",
+                "(facebook,15)"
+        };
+        
+        try {
+            test.assertOutput("queries_limit", reorderedExpectedOutput);
+            fail("assertOutput should fail when the records are unordered.");
+        }
+        catch(ComparisonFailure e) {
+            //Test passes
+        }
+    }
 }

Modified: 
pig/branches/spark/test/org/apache/pig/test/pigunit/pig/TestGruntParser.java
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/pigunit/pig/TestGruntParser.java?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- 
pig/branches/spark/test/org/apache/pig/test/pigunit/pig/TestGruntParser.java 
(original)
+++ 
pig/branches/spark/test/org/apache/pig/test/pigunit/pig/TestGruntParser.java 
Tue Jan 27 02:27:45 2015
@@ -19,7 +19,6 @@ import java.util.Map;
 
 import junit.framework.Assert;
 
-import org.apache.pig.backend.executionengine.ExecException;
 import org.apache.pig.pigunit.pig.GruntParser;
 import org.apache.pig.pigunit.pig.PigServer;
 import org.apache.pig.test.Util;

Modified: 
pig/branches/spark/test/org/apache/pig/tez/TestTezJobControlCompiler.java
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/tez/TestTezJobControlCompiler.java?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/tez/TestTezJobControlCompiler.java 
(original)
+++ pig/branches/spark/test/org/apache/pig/tez/TestTezJobControlCompiler.java 
Tue Jan 27 02:27:45 2015
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTru
 import java.io.IOException;
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
@@ -267,7 +268,9 @@ public class TestTezJobControlCompiler {
                 + "d = group c by name;"
                 + "store d into 'o2';";
         Pair<TezOperPlan, DAG> compiledPlan = compile(query);
-        TezOperator leafOper = compiledPlan.first.getLeaves().get(0);
+        List<TezOperator> leaves = compiledPlan.first.getLeaves();
+        Collections.sort(leaves);
+        TezOperator leafOper = leaves.get(1);
         Vertex leafVertex = 
compiledPlan.second.getVertex(leafOper.getOperatorKey().toString());
         assertEquals(leafVertex.getParallelism(), 7);
     }

Modified: 
pig/branches/spark/test/org/apache/pig/tools/grunt/TestGruntParser.java
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/tools/grunt/TestGruntParser.java?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/tools/grunt/TestGruntParser.java 
(original)
+++ pig/branches/spark/test/org/apache/pig/tools/grunt/TestGruntParser.java Tue 
Jan 27 02:27:45 2015
@@ -25,8 +25,8 @@ import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.pig.ExecType;
 import org.apache.pig.PigServer;
+import org.apache.pig.test.Util;
 import org.apache.pig.tools.grunt.GruntParser.ExplainState;
 import org.junit.Before;
 import org.junit.Test;
@@ -36,8 +36,8 @@ public class TestGruntParser {
     static PigServer pig;
     
     @Before
-    public void setup() throws IOException {
-        pig = new PigServer(ExecType.LOCAL);
+    public void setup() throws Exception {
+        pig = new PigServer(Util.getLocalTestMode());
     }
 
     @Test

Modified: pig/branches/spark/test/tez-local-tests
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/tez-local-tests?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- pig/branches/spark/test/tez-local-tests (original)
+++ pig/branches/spark/test/tez-local-tests Tue Jan 27 02:27:45 2015
@@ -4,3 +4,83 @@
 **/TestDefaultDateTimeZone.java
 **/TestHBaseStorage.java
 **/TestInvokerGenerator.java
+**/TestOrcStorage.java
+**/TestStreamingUDF.java
+**/TestPluckTuple.java
+**/TestImplicitSplitOnTuple.java
+**/TestMockStorage.java
+**/TestLogicalPlanGenerator.java
+**/TestOrcStoragePushdown.java
+**/TestSchemaResetter.java
+**/TestLocationInPhysicalPlan.java
+**/TestAlgebraicEvalLocal.java
+**/TestAssert.java
+**/TestBatchAliases.java
+**/TestBlackAndWhitelistValidator.java
+**/TestBuiltin.java
+**/TestBuiltInBagToTupleOrString.java
+**/TestBuiltinInvoker.java
+**/TestCase.java
+**/TestCommit.java
+**/TestDataBagAccess.java
+**/TestFilterOpNumeric.java
+**/TestFilterOpString.java
+**/TestForEachNestedPlanLocal.java
+**/TestForEachStar.java
+**/TestIn.java
+**/TestInfixArithmetic.java
+**/TestInputOutputFileValidator.java
+**/TestJsonLoaderStorage.java
+**/TestLimitSchemaStore.java
+**/TestLoad.java
+**/TestLocal.java
+**/TestLocal2.java
+**/TestLOLoadDeterminedSchema.java
+**/TestMacroExpansion.java
+**/TestNullConstant.java
+**/TestOrderBy3.java
+**/TestParser.java
+**/TestPigContext.java
+**/TestPigSplit.java
+**/TestPigStorage.java
+**/TestPoissonSampleLoader.java
+**/TestPONegative.java
+**/TestProject.java
+**/TestProjectStarExpander.java
+**/TestRank1.java
+**/TestRank2.java
+**/TestRegisteredJarVisibility.java
+**/TestRelationToExprProject.java
+**/TestScriptingLanguagePython.java
+**/TestSplit.java
+**/TestSplitIndex.java
+**/TestStoreInstances.java
+**/TestStreamingLocal.java
+**/TestTypedMap.java
+**/TestUDF.java
+**/TestUDFContext.java
+**/TestUDFGroovy.java
+**/TestUDFWithoutParameter.java
+**/TestUnion.java
+**/TestUTF8.java
+**/TestGruntParser.java
+**/TestAutoLocalMode.java
+**/TestEvalPipelineLocal.java
+**/TestFetch.java
+**/TestPigRunner.java
+**/TestPigServerWithMacros.java
+**/TestMultiQueryBasic.java
+**/TestLoadStoreFuncLifeCycle.java
+**/TestCubeOperator.java
+**/TestJoinLocal.java
+**/TestMultiQuery.java
+**/TestNewPlanColumnPrune.java
+**/TestPigServerLocal.java
+**/TestPruneColumn.java
+**/TestRank3.java
+**/TestScalarAliasesLocal.java
+**/TestPigStatsTez.java
+**/TestStoreLocal.java
+**/TestPOPartialAggPlanTez.java
+**/TestMultiQueryLocal.java
+**/TestUnionOnSchema.java

Modified: pig/branches/spark/test/tez-tests
URL: 
http://svn.apache.org/viewvc/pig/branches/spark/test/tez-tests?rev=1654955&r1=1654954&r2=1654955&view=diff
==============================================================================
--- pig/branches/spark/test/tez-tests (original)
+++ pig/branches/spark/test/tez-tests Tue Jan 27 02:27:45 2015
@@ -67,3 +67,4 @@
 **/TestTezCompiler.java
 **/TestTezJobControlCompiler.java
 **/TestTezLauncher.java
+**/TestPigServerWithMacrosRemote.java


Reply via email to