Return-Path: Delivered-To: apmail-incubator-pig-dev-archive@locus.apache.org Received: (qmail 18175 invoked from network); 18 Mar 2008 23:22:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2008 23:22:15 -0000 Received: (qmail 35551 invoked by uid 500); 18 Mar 2008 23:22:13 -0000 Delivered-To: apmail-incubator-pig-dev-archive@incubator.apache.org Received: (qmail 35523 invoked by uid 500); 18 Mar 2008 23:22:13 -0000 Mailing-List: contact pig-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pig-dev@incubator.apache.org Delivered-To: mailing list pig-dev@incubator.apache.org Received: (qmail 35514 invoked by uid 99); 18 Mar 2008 23:22:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 16:22:13 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 23:21:32 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 74736234C0A9 for ; Tue, 18 Mar 2008 16:20:24 -0700 (PDT) Message-ID: <34235584.1205882424475.JavaMail.jira@brutus> Date: Tue, 18 Mar 2008 16:20:24 -0700 (PDT) From: "Xu Zhang (JIRA)" To: pig-dev@incubator.apache.org Subject: [jira] Commented: (PIG-152) Solution for PIG-123 might have introduced parsing errors on Windows with the Pig unit tests In-Reply-To: <262171055.1205786064443.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/PIG-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580167#action_12580167 ] Xu Zhang commented on PIG-152: ------------------------------ Tested already before submitting the patch. > Solution for PIG-123 might have introduced parsing errors on Windows with the Pig unit tests > -------------------------------------------------------------------------------------------- > > Key: PIG-152 > URL: https://issues.apache.org/jira/browse/PIG-152 > Project: Pig > Issue Type: Bug > Components: impl > Reporter: Xu Zhang > Assignee: Pi Song > Attachments: PIG_152.patch > > > *Since the changes for PIG-123 were checked in, we got lots of parsing errors when running the unit tests on Windows.* > It seems all these errors are generated when a query string that contains a single quote for the path of the data file is passed into the PigServer::registerQuery() method. > Here is an example of such an error and the location where it is generated in the unit test code (on the line "pig.registerQuery(query);" in the following code): > {noformat} > org.apache.pig.impl.logicalLayer.parser.TokenMgrError: Lexical error at line 1, column 39. Encountered: "W" (87), after : "\'file:c:\\" > at org.apache.pig.impl.logicalLayer.parser.QueryParserTokenManager.getNextToken(QueryParserTokenManager.java:1599) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.jj_consume_token(QueryParser.java:4069) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.FileName(QueryParser.java:717) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.LoadClause(QueryParser.java:615) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:497) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:425) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1043) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.CogroupClause(QueryParser.java:996) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:523) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:425) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.ForEachClause(QueryParser.java:1364) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:552) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:373) > at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:227) > at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47) > at org.apache.pig.PigServer.registerQuery(PigServer.java:237) > at org.apache.pig.test.TestAlgebraicEval.testSimpleCount(TestAlgebraicEval.java:50) > Standard Output > Starting DataNode 0 with dfs.data.dir: dfs\data\data1,dfs\data\data2 > Starting DataNode 1 with dfs.data.dir: dfs\data\data3,dfs\data\data4 > Starting DataNode 2 with dfs.data.dir: dfs\data\data5,dfs\data\data6 > Starting DataNode 3 with dfs.data.dir: dfs\data\data7,dfs\data\data8 > myid = foreach (group (load 'file:c:\WINDOWS\TEMP\test39837txt') all) generate COUNT($1); > myid = foreach (group (load 'file:c:\WINDOWS\TEMP\test39838txt') all) generate group, COUNT($1) ; > myid = foreach (group (load 'file:c:\WINDOWS\TEMP\test39839txt') all) generate COUNT($1), group ; > myid = foreach (group (load 'file:c:\WINDOWS\TEMP\test39840txt' using org.apache.pig.builtin.PigStorage(':')) by $0) generate group, COUNT($1.$1) ; > myid = foreach (group (load 'file:c:\WINDOWS\TEMP\test39841txt' using org.apache.pig.builtin.PigStorage(':')) by $0) generate group, COUNT($1.$1), COUNT($1.$0) ; > {noformat} > Here is the corresponding code: > {code} > public class TestAlgebraicEval extends TestCase { > > MiniCluster cluster = MiniCluster.buildCluster(); > @Test > public void testSimpleCount() throws Throwable { > int LOOP_COUNT = 1024; > PigServer pig = new PigServer(MAPREDUCE); > File tmpFile = File.createTempFile("test", "txt"); > PrintStream ps = new PrintStream(new FileOutputStream(tmpFile)); > for(int i = 0; i < LOOP_COUNT; i++) { > ps.println(i); > } > ps.close(); > String query = "myid = foreach (group (load 'file:" + tmpFile + "') all) generate COUNT($1);"; > System.out.println(query); > pig.registerQuery(query); > Iterator it = pig.openIterator("myid"); > tmpFile.delete(); > Tuple t = (Tuple)it.next(); > Double count = t.getAtomField(0).numval(); > assertEquals(count, (double)LOOP_COUNT); > } > . > . > . > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.