Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestNewPlanOperatorPlan.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestNewPlanOperatorPlan.java?rev=988256&r1=988255&r2=988256&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestNewPlanOperatorPlan.java 
(original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestNewPlanOperatorPlan.java Mon 
Aug 23 19:10:32 2010
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.pig.FuncSpec;
+import org.apache.pig.builtin.PigStorage;
 import org.apache.pig.data.DataType;
 import org.apache.pig.impl.io.FileSpec;
 import org.apache.pig.impl.logicalLayer.FrontendException;
@@ -63,6 +64,11 @@ public class TestNewPlanOperatorPlan ext
         }
     }
     
+    static public class DummyLoad extends PigStorage {
+        public DummyLoad(String a, String b) {}
+        public DummyLoad(String a) {}
+        
+    }
     private static class SillyOperator extends Operator {
         private String name;
         
@@ -812,7 +818,7 @@ public class TestNewPlanOperatorPlan ext
             aschema.addField(new LogicalSchema.LogicalFieldSchema(
                 "x", null, DataType.INTEGER));
             LOLoad A = new LOLoad(new FileSpec("/abc",
-                new FuncSpec("/fooload", new String[] {"x", "y"})), aschema, 
lp, null);
+                new FuncSpec(DummyLoad.class.getName(), new String[] {"x", 
"y"})), aschema, lp, null);
             lp.add(A);
         
             // B = load
@@ -862,7 +868,7 @@ public class TestNewPlanOperatorPlan ext
             aschema.addField(new LogicalSchema.LogicalFieldSchema(
                 "x", null, DataType.INTEGER));
             LOLoad A = new LOLoad(new FileSpec("/abc",
-                new FuncSpec("/fooload", new String[] {"x", "y"})), aschema, 
lp1, null);
+                new FuncSpec(DummyLoad.class.getName(), new String[] {"x", 
"y"})), aschema, lp1, null);
             lp1.add(A);
             
             // B = load
@@ -917,11 +923,11 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
         
         LOLoad load2 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "z"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
aschema1, lp, null);
         lp.add(load2);
         
         assertFalse(load1.isEqual(load2));
@@ -935,11 +941,11 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
         
         LOLoad load3 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", "x")), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), "x")), aschema1, lp, null);
         lp.add(load3);
         
         assertFalse(load1.isEqual(load3));
@@ -953,12 +959,12 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
         
          // Different function names in FuncSpec
         LOLoad load4 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foobar", new String[] {"x", "z"})), aschema1, lp, 
null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
aschema1, lp, null);
         lp.add(load4);
         
         assertFalse(load1.isEqual(load4));
@@ -971,12 +977,12 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
     
         // Different file name
         LOLoad load5 = new LOLoad(new FileSpec("/def",
-            new FuncSpec("foo", new String[] {"x", "z"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
aschema1, lp, null);
         lp.add(load5);
         
         assertFalse(load1.isEqual(load5));
@@ -989,7 +995,7 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
         
         // Different schema
@@ -998,7 +1004,7 @@ public class TestNewPlanOperatorPlan ext
             "x", null, DataType.CHARARRAY));
         
         LOLoad load6 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "z"})), aschema2, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
aschema2, lp, null);
         lp.add(load6);
             
         assertFalse(load1.isEqual(load6));
@@ -1009,11 +1015,11 @@ public class TestNewPlanOperatorPlan ext
         LogicalPlan lp = new LogicalPlan();
         // Test that two loads with no schema are still equal
         LOLoad load7 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), null, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
null, lp, null);
         lp.add(load7);
         
         LOLoad load8 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), null, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
null, lp, null);
         lp.add(load8);
         
         assertTrue(load7.isEqual(load8));
@@ -1026,12 +1032,12 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad load1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "y"})), aschema1, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp, null);
         lp.add(load1);
         
         // Test that one with schema and one without breaks equality
         LOLoad load9 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("foo", new String[] {"x", "z"})), null, lp, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
null, lp, null);
         lp.add(load9);
         
         assertFalse(load1.isEqual(load9));
@@ -1498,7 +1504,7 @@ public class TestNewPlanOperatorPlan ext
         aschema1.addField(new LogicalSchema.LogicalFieldSchema(
             "x", null, DataType.INTEGER));
         LOLoad A1 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("/fooload", new String[] {"x", "y"})), aschema1, lp1, 
null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "y"})), 
aschema1, lp1, null);
         lp1.add(A1);
         
         LogicalExpressionPlan fp1 = new LogicalExpressionPlan();
@@ -1516,7 +1522,7 @@ public class TestNewPlanOperatorPlan ext
         
         LogicalPlan lp2 = new LogicalPlan();
         LOLoad A2 = new LOLoad(new FileSpec("/abc",
-            new FuncSpec("/foo", new String[] {"x", "z"})), null, lp2, null);
+            new FuncSpec(DummyLoad.class.getName(), new String[] {"x", "z"})), 
null, lp2, null);
         lp2.add(A2);
         
         LogicalExpressionPlan fp2 = new LogicalExpressionPlan();
@@ -1529,7 +1535,7 @@ public class TestNewPlanOperatorPlan ext
         lp2.add(D2);
         lp2.connect(A2, D2);
         
-        assertFalse(D1.isEqual(D2));
+        assertTrue(D1.isEqual(D2));
     }
     
  

Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestPigRunner.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestPigRunner.java?rev=988256&r1=988255&r2=988256&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestPigRunner.java (original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestPigRunner.java Mon Aug 23 
19:10:32 2010
@@ -161,7 +161,7 @@ public class TestPigRunner {
                     0)).getAlias());
             assertEquals("B", ((JobStats) stats.getJobGraph().getPredecessors(
                     js).get(0)).getAlias());
-            assertEquals("B", js.getAlias()); 
+            assertEquals("B,C", js.getAlias()); 
         } finally {
             new File(PIG_FILE).delete();
             Util.deleteFile(cluster, OUTPUT_FILE);

Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestPruneColumn.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestPruneColumn.java?rev=988256&r1=988255&r2=988256&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestPruneColumn.java (original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestPruneColumn.java Mon Aug 23 
19:10:32 2010
@@ -23,9 +23,11 @@ import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.PrintStream;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.log4j.FileAppender;
 import org.apache.log4j.Level;
@@ -33,12 +35,11 @@ import org.apache.log4j.Logger;
 import org.apache.log4j.SimpleLayout;
 import org.apache.pig.ExecType;
 import org.apache.pig.FilterFunc;
-import org.apache.pig.LoadPushDown;
 import org.apache.pig.PigServer;
 import org.apache.pig.builtin.PigStorage;
 import org.apache.pig.data.Tuple;
 import org.apache.pig.impl.logicalLayer.FrontendException;
-import org.apache.pig.impl.logicalLayer.optimizer.PruneColumns;
+import org.apache.pig.newplan.logical.rules.ColumnPruneVisitor;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -95,7 +96,7 @@ public class TestPruneColumn extends Tes
     @Before
     @Override
     public void setUp() throws Exception{
-        Logger logger = Logger.getLogger(PruneColumns.class);
+        Logger logger = Logger.getLogger(ColumnPruneVisitor.class);
         logger.removeAllAppenders();
         logger.setLevel(Level.INFO);
         SimpleLayout layout = new SimpleLayout();
@@ -192,17 +193,42 @@ public class TestPruneColumn extends Tes
         
         try {
             reader = new BufferedReader(new FileReader(logFile));
-            String logMessage="";
+            List<String> logMessages=new ArrayList<String>();
             String line;
             while ((line=reader.readLine())!=null)
             {
-                logMessage = logMessage + line + "\n";
+                logMessages.add(line);
             }
+            
+            // Check if all messages appear in the log
             for (int i=0;i<messages.length;i++)
             {
-                if (!logMessage.contains(messages[i]))
+                boolean found = false;
+                for (int j=0;j<logMessages.size();j++)
+                if (logMessages.get(j).contains(messages[i])) {
+                    found = true;
+                    break;
+                }
+                if (!found)
                     return false;
             }
+            
+            // Check no other log besides messages
+            for (int i=0;i<logMessages.size();i++) {
+                boolean found = false;
+                for (int j=0;j<messages.length;j++) {
+                    if (logMessages.get(i).contains(messages[j])) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    if (logMessages.get(i).contains("Columns pruned for")||
+                            logMessages.get(i).contains("Map key required 
for")) {
+                        return false;
+                    }
+                }
+            }
             return true;
         }
         catch (IOException e) {
@@ -250,8 +276,7 @@ public class TestPruneColumn extends Tes
         assertTrue((Integer)t.get(0) == 5);
         assertTrue((Integer)t.get(1) == 2);
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0"}));
     }
     
     @Test
@@ -274,8 +299,7 @@ public class TestPruneColumn extends Tes
         assertTrue((Integer)t.get(0) == 2);
         assertTrue((Integer)t.get(1) == 2);
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1",
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
     
     @Test
@@ -298,8 +322,7 @@ public class TestPruneColumn extends Tes
         assertTrue((Integer)t.get(0) == 2);
         assertTrue((Integer)t.get(1) == 5);
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2"}));
     }
     
     @Test
@@ -321,9 +344,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0", 
-                "No map keys pruned for A", "No column pruned for B", 
-                "No map keys pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0"}));
     }
     
     @Test
@@ -345,8 +366,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0",
-                "No map keys pruned for A", "Columns pruned for B: $0", 
-                "No map keys pruned for B"}));
+                "Columns pruned for B: $0"}));
     }
     
     @Test
@@ -365,8 +385,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -390,8 +409,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -419,8 +437,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -438,8 +455,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2"}));
     }
     
     @Test
@@ -457,8 +473,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2"}));
     }
     
     @Test
@@ -535,8 +550,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A", "Columns pruned for B: $0", "No 
map keys pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for B: 
$0"}));
     }
     
     @Test
@@ -554,8 +568,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -581,8 +594,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -616,9 +628,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A", "No column pruned for B", 
-                "No map keys pruned for B"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -644,8 +654,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2"}));
     }
     
     @Test
@@ -711,8 +720,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0", 
-        "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0"}));
     }
     
     @Test
@@ -816,7 +824,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A", "Columns pruned for B: $1", "No map 
keys pruned for B"}));
+            "Columns pruned for B: $1"}));
     }
     
     @Test
@@ -857,7 +865,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1", 
-            "No map keys pruned for A", "Columns pruned for B: $1", "No map 
keys pruned for B"}));
+            "Columns pruned for B: $1"}));
     }
 
     @Test
@@ -885,7 +893,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A", "Columns pruned for B: $1", "No map 
keys pruned for B"}));
+            "Columns pruned for B: $1"}));
     }
     
     @Test
@@ -910,8 +918,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$2"}));
     }
     
     @Test
@@ -935,8 +942,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
     
     @Test
@@ -960,8 +966,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2"}));
     }
     
     @Test
@@ -985,8 +990,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-            "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -1010,8 +1014,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-            "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -1036,8 +1039,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-            "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -1061,8 +1063,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2"}));
     }
     
     @Test
@@ -1086,8 +1087,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-            "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     @Test
@@ -1117,7 +1117,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A", "Columns pruned for B: $1, $2", "No 
map keys pruned for B"}));
+            "Columns pruned for B: $1, $2"}));
     }
     
     @Test
@@ -1165,8 +1165,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "Map key required for A: $1->[key1]"}));
+        assertTrue(checkLogFileMessage(new String[]{"Map key required for A: 
$1->[key1]"}));
     }
     
     @Test
@@ -1192,9 +1191,9 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0", 
-                "Map key required for A: $1->[key2,key1]"}));
+                "Map key required for A: $1->[key2, key1]"}));
     }
-    
+    /*
     @Test
     public void testMapKey3() throws Exception {
         pigServer.registerQuery("A = load '"+ 
Util.generateURI(tmpFile3.toString(), pigServer.getPigContext()) + "' as 
(a0:int, a1:map[]);");
@@ -1211,9 +1210,8 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0", 
-                "No map keys pruned for A"}));
-    }
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$0"}));
+    }*/
     
     @Test
     public void testMapKey4() throws Exception {
@@ -1237,8 +1235,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "Map key required for A: $1->[key1]"}));
+        assertTrue(checkLogFileMessage(new String[]{"Map key required for A: 
$1->[key1]"}));
     }
     
     @Test
@@ -1263,8 +1260,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "Map key required for A: $1->[key1]"}));
+        assertTrue(checkLogFileMessage(new String[]{"Map key required for A: 
$1->[key1]"}));
     }
     
     @Test
@@ -1288,8 +1284,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1"}));
     }
     
     @Test
@@ -1345,8 +1340,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2"}));
     }
     
     @Test
@@ -1379,8 +1373,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
         
     }
 
@@ -1471,8 +1464,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1, 
$2", 
-                "No map keys pruned for A", "Columns pruned for B: $1", 
-                "No map keys pruned for B"}));
+                "Columns pruned for B: $1"}));
     }
     
     @Test
@@ -1497,8 +1489,7 @@ public class TestPruneColumn extends Tes
         assertFalse(iter.hasNext());
         
         assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1", 
-                "No map keys pruned for A", "Columns pruned for B: $1", 
-                "No map keys pruned for B"}));
+                "Columns pruned for B: $1"}));
     }
     
     @Test
@@ -1530,9 +1521,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A", "Columns pruned for B: $0", 
-                "No map keys pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for B: 
$0"}));
     }
     
     // See PIG-1128
@@ -1554,8 +1543,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
 
     // See PIG-1127
@@ -1573,8 +1561,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$2", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$2"}));
     }
     
     // See PIG-1142
@@ -1600,8 +1587,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A", 
-                "No map keys pruned for A", "Columns pruned for B: $0, $1", 
"No map keys pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for B: $0, 
$1"}));
     }
     
     @Test
@@ -1618,8 +1604,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1"}));
     }
     
     @Test
@@ -1636,8 +1621,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1", 
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1"}));
     }
     
     @Test
@@ -1661,8 +1645,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1", 
-            "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$1"}));
     }
     
     @Test
@@ -1688,8 +1671,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for C: $0, 
$1", 
-            "No map keys pruned for C"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for C: $0, 
$1"}));
     }
 
     // See PIG-1165
@@ -1710,8 +1692,7 @@ public class TestPruneColumn extends Tes
         
         assertFalse(iter.hasNext());
         
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$2", 
-            "No map keys pruned for A", "No column pruned for B", "No map keys 
pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $0, 
$2"}));
     }
     
     // See PIG-1146
@@ -1755,9 +1736,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
 
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1",
-            "No map keys pruned for A", "No column pruned for B",
-            "No map keys pruned for B"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
     
     // See PIG-1176
@@ -1832,8 +1811,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
 
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1",
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
     
     // See PIG-1210
@@ -1854,8 +1832,7 @@ public class TestPruneColumn extends Tes
 
         assertFalse(iter.hasNext());
 
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A",
-            "No map keys pruned for A", "[0,1,2]"}));
+        assertTrue(emptyLogFileMessage());
     }
     
     // See PIG-1272
@@ -1874,8 +1851,7 @@ public class TestPruneColumn extends Tes
         t = iter.next();
         assertTrue(t.toString().equals("(2,5,2,2)"));
 
-        assertTrue(checkLogFileMessage(new String[]{"No column pruned for A",
-                "No map keys pruned for A"}));
+        assertTrue(emptyLogFileMessage());
     }
 
     // See PIG-1493
@@ -1894,8 +1870,7 @@ public class TestPruneColumn extends Tes
         t = iter.next();
         assertTrue(t.toString().equals("(2,2)"));
 
-        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: $1",
-                "No map keys pruned for A"}));
+        assertTrue(checkLogFileMessage(new String[]{"Columns pruned for A: 
$1"}));
     }
 
 }

Modified: hadoop/pig/trunk/test/org/apache/pig/test/TestStore.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/test/org/apache/pig/test/TestStore.java?rev=988256&r1=988255&r2=988256&view=diff
==============================================================================
--- hadoop/pig/trunk/test/org/apache/pig/test/TestStore.java (original)
+++ hadoop/pig/trunk/test/org/apache/pig/test/TestStore.java Mon Aug 23 
19:10:32 2010
@@ -401,7 +401,7 @@ public class TestStore extends junit.fra
             ExecType[] modes = new ExecType[] { ExecType.MAPREDUCE, 
ExecType.LOCAL};
             String[] inputData = new String[]{"hello\tworld", "bye\tworld"};
             
-            String script = "a = load '"+ inputFileName + "';" +
+            String script = "a = load '"+ inputFileName + "' as (a0:chararray, 
a1:chararray);" +
                        "store a into '" + outputFileName + "' using " + 
                        DUMMY_STORE_CLASS_NAME + "();";
             


Reply via email to