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 2014/05/22 03:54:15 UTC
svn commit: r1596732 - in /pig/trunk: CHANGES.txt
src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj
test/org/apache/pig/TestMain.java
Author: daijy
Date: Thu May 22 01:54:14 2014
New Revision: 1596732
URL: http://svn.apache.org/r1596732
Log:
Rollback PIG-3772: Syntax error when casting an inner schema of a bag and line break involved
Modified:
pig/trunk/CHANGES.txt
pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj
pig/trunk/test/org/apache/pig/TestMain.java
Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1596732&r1=1596731&r2=1596732&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu May 22 01:54:14 2014
@@ -181,8 +181,6 @@ PIG-3905: 0.12.1 release can't be build
PIG-3894: Datetime function AddDuration, SubtractDuration and all Between functions don't check for null values in the input tuple (jennythompson via cheolsoo)
-PIG-3772: Syntax error when casting an inner schema of a bag and line break involved (ssvinarchukhorton via daijy)
-
PIG-3889: Direct fetch doesn't set job submission timestamps (cheolsoo)
PIG-3895: Pigmix run script has compilation error (rohini)
Modified: pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj?rev=1596732&r1=1596731&r2=1596732&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj (original)
+++ pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj Thu May 22 01:54:14 2014
@@ -261,7 +261,7 @@ TOKEN_MGR_DECLS : {
<"'"> {prevState = PIG_START;} : IN_STRING
| <"`"> {prevState = PIG_START;} : IN_COMMAND
| <(" " | "\t")+["A","a"]["S","s"](" " | "\t")+ > {prevState = PIG_START;} : SCHEMA_DEFINITION
-| <(" " | "\t")+["G","g"]["E","e"]["N","n"]["E","e"]["R","r"]["A","a"]["T","t"]["E","e"](" " | "\t" | "r" | "\n")+ > {prevState = PIG_START;} : GENERATE
+| <(" " | "\t")+["G","g"]["E","e"]["N","n"]["E","e"]["R","r"]["A","a"]["T","t"]["E","e"](" " | "\t")+ > {prevState = PIG_START;} : GENERATE
| <"{"> {pigBlockLevel = 1;} : IN_BLOCK
| <"}"> {if (true) throw new TokenMgrError("Unmatched '}'", TokenMgrError.LEXICAL_ERROR);}
| <";"> : PIG_END
@@ -364,7 +364,7 @@ TOKEN_MGR_DECLS : {
{
<"\""> {prevState = IN_BLOCK;} : IN_DOUBLE_QUOTED_STRING
| <(" " | "\t")+["A","a"]["S","s"](" " | "\t")+ > {prevState = IN_BLOCK;} : SCHEMA_DEFINITION
-| <(" " | "\t")+["G","g"]["E","e"]["N","n"]["E","e"]["R","r"]["A","a"]["T","t"]["E","e"](" " | "\t" | "r" | "\n")+> {prevState = IN_BLOCK;} : GENERATE
+| <(" " | "\t")+["G","g"]["E","e"]["N","n"]["E","e"]["R","r"]["A","a"]["T","t"]["E","e"](" " | "\t")+> {prevState = IN_BLOCK;} : GENERATE
| <"{"> {pigBlockLevel++;}
| <"}"(";")?> {pigBlockLevel--; if (pigBlockLevel == 0) SwitchTo(PIG_END);}
| <"'"> {prevState = IN_BLOCK;} : IN_STRING
Modified: pig/trunk/test/org/apache/pig/TestMain.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/TestMain.java?rev=1596732&r1=1596731&r2=1596732&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/TestMain.java (original)
+++ pig/trunk/test/org/apache/pig/TestMain.java Thu May 22 01:54:14 2014
@@ -24,10 +24,8 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
import java.io.BufferedWriter;
-import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
-import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
@@ -37,7 +35,6 @@ import org.apache.pig.impl.logicalLayer.
import org.apache.pig.parser.ParserException;
import org.apache.pig.parser.SourceLocation;
import org.apache.pig.test.TestPigRunner.TestNotificationListener;
-import org.apache.pig.test.Util;
import org.apache.pig.tools.parameters.ParameterSubstitutionException;
import org.apache.pig.tools.pigstats.PigStats;
import org.junit.Test;
@@ -129,35 +126,6 @@ public class TestMain {
}
}
- @Test
- public void testParseInputScript() throws Exception {
- File input = Util.createInputFile("tmp", "",
- new String[]{"{(1,1.0)}\ttestinputstring1",
- "{(2,2.0)}\ttestinputstring1",
- "{(3,3.0)}\ttestinputstring1",
- "{(4,4.0)}\ttestinputstring1"}
- );
- File out = new File(System.getProperty("java.io.tmpdir")+"/testParseInputScriptOut");
- File scriptFile = Util.createInputFile("pigScript", "",
- new String[]{"A = load '"+input.getAbsolutePath()+"' as (a:{(x:chararray, y:float)}, b:chararray);",
- "B = foreach A generate\n" +
- " b,\n" +
- " (bag{tuple(long)}) a.x as ax:{(x:long)};",
- "store B into '"+out.getAbsolutePath()+"';"}
- );
-
- Main.run(new String[]{"-x", "local", scriptFile.getAbsolutePath()}, null);
- BufferedReader file = new BufferedReader(new FileReader(new File(out.getAbsolutePath()+"/part-m-00000")));
- String line;
- int count = 0;
- while(( line = file.readLine()) != null) {
- count++;
- }
- assertEquals(4,count);
- Util.deleteDirectory(new File(out.getAbsolutePath()));
- assertTrue(!new File(out.getAbsolutePath()).exists());
- }
-
public static class TestNotificationListener2 extends TestNotificationListener {
protected boolean hadArgs = false;
public TestNotificationListener2() {}