Author: olga
Date: Fri May  2 14:33:46 2008
New Revision: 652921

URL: http://svn.apache.org/viewvc?rev=652921&view=rev
Log:
PIG-227: making store function optional in stream spec

Modified:
    incubator/pig/trunk/CHANGES.txt
    
incubator/pig/trunk/src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt
    incubator/pig/trunk/test/org/apache/pig/test/TestStreaming.java

Modified: incubator/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/pig/trunk/CHANGES.txt?rev=652921&r1=652920&r2=652921&view=diff
==============================================================================
--- incubator/pig/trunk/CHANGES.txt (original)
+++ incubator/pig/trunk/CHANGES.txt Fri May  2 14:33:46 2008
@@ -267,3 +267,6 @@
        PIG-176: Change bag spilling so that bags below a certain threshold are
        not spilled, thus avoiding proliferation of small files (pi_song via
        gates).
+    
+    PIG-227: making load/store function optional in stream input/output spec
+    (acmurthy via olgan)

Modified: 
incubator/pig/trunk/src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt
URL: 
http://svn.apache.org/viewvc/incubator/pig/trunk/src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt?rev=652921&r1=652920&r2=652921&view=diff
==============================================================================
--- 
incubator/pig/trunk/src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt 
(original)
+++ 
incubator/pig/trunk/src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt 
Fri May  2 14:33:46 2008
@@ -1542,11 +1542,16 @@
 {
     String stream, deserializer;
     StreamingCommand.HandleSpec[] handleSpecs;
-    String functionName, functionArgs;
+    String functionName = "PigStorage", functionArgs="";
 } 
 {
-    
-    stream = CommandStream() <USING> functionName = QualifiedFunction() "(" 
functionArgs = StringList() ")"
+    stream = CommandStream() 
+    [
+        <USING> functionName = QualifiedFunction() 
+        [
+            "(" functionArgs = StringList() ")"
+        ]
+    ]
     {
         deserializer = functionName + "(" + functionArgs + ")";
         command.addHandleSpec(handle, 
@@ -1555,9 +1560,15 @@
     }
     (
         "," 
-        stream = CommandStream() <USING> functionName = QualifiedFunction() 
"(" functionArgs = StringList() ")"
+        stream = CommandStream() 
+        [
+            <USING> functionName = QualifiedFunction() 
+            [
+                "(" functionArgs = StringList() ")"
+            ]
+        ] 
         {
-               deserializer = functionName + "(" + functionArgs + ")";
+            deserializer = functionName + "(" + functionArgs + ")";
             command.addHandleSpec(handle, 
                                   new HandleSpec(stream, deserializer)
                                  );

Modified: incubator/pig/trunk/test/org/apache/pig/test/TestStreaming.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/trunk/test/org/apache/pig/test/TestStreaming.java?rev=652921&r1=652920&r2=652921&view=diff
==============================================================================
--- incubator/pig/trunk/test/org/apache/pig/test/TestStreaming.java (original)
+++ incubator/pig/trunk/test/org/apache/pig/test/TestStreaming.java Fri May  2 
14:33:46 2008
@@ -406,7 +406,7 @@
                 "define CMD `" + command.getName() + " foo bar foobar` " +
                 "ship ('" + command + "') " +
                 "input('foo' using " + PigStorage.class.getName() + "(',')) " +
-                "output('bar' using " + PigStorage.class.getName() + "(','), " 
+
+                "output('bar', " +
                 "'foobar' using " + PigStorage.class.getName() + "(',')) " +
                 "stderr();"); 
         pigServer.registerQuery("IP = load 'file:" + input + "' using " + 
@@ -498,7 +498,7 @@
 
         // Pig query to run
         pigServer.registerQuery("define CMD `"+ simpleEchoStreamingCommand + 
-                                "` input(stdin using PigDump());");
+                                "` input(stdin using PigDump);");
         pigServer.registerQuery("IP = load 'file:" + input + "' using " + 
                                 PigStorage.class.getName() + "(',') " +
                                 "split by 'file';");


Reply via email to