1 diff -Naur pig-original/src/.svn/README.txt pig-galago/src/.svn/README.txt
2 --- pig-original/src/.svn/README.txt 2007-04-05 11:24:35.000000000 -0400
3 +++ pig-galago/src/.svn/README.txt 1969-12-31 19:00:00.000000000 -0500
5 -This is a Subversion working copy administrative directory.
6 -Visit http://subversion.tigris.org/ for more information.
7 diff -Naur pig-original/src/.svn/entries pig-galago/src/.svn/entries
8 --- pig-original/src/.svn/entries 2007-04-05 11:24:35.000000000 -0400
9 +++ pig-galago/src/.svn/entries 1969-12-31 19:00:00.000000000 -0500
11 -<?xml version="1.0" encoding="utf-8"?>
15 - committed-rev="1619"
17 - committed-date="2007-04-05T15:23:39.957315Z"
18 - url="svn+ssh://research6/pig/trunk/pig/src.oss/src"
21 - uuid="07b68ec7-261b-0410-92da-dbfe1b73ca74"
22 - repos="svn+ssh://research6"
28 diff -Naur pig-original/src/.svn/format pig-galago/src/.svn/format
29 --- pig-original/src/.svn/format 2007-04-05 11:24:35.000000000 -0400
30 +++ pig-galago/src/.svn/format 1969-12-31 19:00:00.000000000 -0500
33 diff -Naur pig-original/src/com/yahoo/pig/EvalFunc.java pig-galago/src/com/yahoo/pig/EvalFunc.java
34 --- pig-original/src/com/yahoo/pig/EvalFunc.java 2007-04-05 11:24:35.000000000 -0400
35 +++ pig-galago/src/com/yahoo/pig/EvalFunc.java 2007-08-31 09:54:55.000000000 -0400
37 // report that progress is being made (otherwise hadoop times out after 600 seconds working on one outer tuple)
38 protected void progress() {
39 if (PigMapReduce.reporter != null) {
41 - PigMapReduce.reporter.progress();
42 - } catch (IOException ignored) {
44 + PigMapReduce.reporter.progress();
48 diff -Naur pig-original/src/com/yahoo/pig/PigServer.java pig-galago/src/com/yahoo/pig/PigServer.java
49 --- pig-original/src/com/yahoo/pig/PigServer.java 2007-04-05 11:24:35.000000000 -0400
50 +++ pig-galago/src/com/yahoo/pig/PigServer.java 2007-09-05 08:28:08.000000000 -0400
53 package com.yahoo.pig;
55 +import com.yahoo.pig.impl.galago.POGalago;
56 import java.io.IOException;
57 import java.io.InputStream;
58 import java.util.HashMap;
61 * Use the Experimental Hadoop framework; not available yet.
66 + * Use the Galago TupleFlow framework
71 private static ExecType parseExecType(String str) throws IOException {
73 if (normStr.equals("mapred")) return ExecType.MAPREDUCE;
74 if (normStr.equals("pig")) return ExecType.PIG;
75 if (normStr.equals("pigbody")) return ExecType.PIG;
76 + if (normStr.equals("galago")) return ExecType.GALAGO;
78 throw new IOException("Unrecognized exec type: " + str);
81 IntermedResult readFrom = (IntermedResult) queryResults.get(id);
83 if (!readFrom.executed()) {
84 + if (pigContext.getExecType() == ExecType.GALAGO) {
85 + LogicalOperator root = readFrom.lp.root();
86 + LogicalOperator store = new LOStore( pigContext, root, filename, func, false );
87 + LogicalPlan lp = new LogicalPlan( store, pigContext );
88 + readFrom = new IntermedResult( lp );
90 readFrom.compile(queryResults);
91 - if (pigContext.getExecType() != ExecType.LOCAL) {
92 + if (pigContext.getExecType() == ExecType.MAPREDUCE) {
93 POMapreduce pom = (POMapreduce)readFrom.pp.root;
95 pom.outputFile = filename;
96 diff -Naur pig-original/src/com/yahoo/pig/builtin/LOWER.java pig-galago/src/com/yahoo/pig/builtin/LOWER.java
97 --- pig-original/src/com/yahoo/pig/builtin/LOWER.java 1969-12-31 19:00:00.000000000 -0500
98 +++ pig-galago/src/com/yahoo/pig/builtin/LOWER.java 2007-09-06 13:22:47.000000000 -0400
103 + * September 6, 2007 -- Trevor Strohman
105 + * BSD License (http://www.galagosearch.org/license)
108 +package com.yahoo.pig.builtin;
110 +import com.yahoo.pig.BagEvalFunc;
111 +import com.yahoo.pig.data.DataCollector;
112 +import com.yahoo.pig.data.Tuple;
113 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaField;
114 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaItem;
115 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaItemList;
116 +import java.io.IOException;
122 +public class LOWER extends BagEvalFunc {
124 + public void exec(Tuple input, DataCollector output) throws IOException {
125 + String str = input.getAtomField(0).strval();
126 + Tuple t = new Tuple(1);
127 + t.setField(0, str.toLowerCase());
132 + public SchemaItem outputSchema() {
133 + SchemaItemList schema = new SchemaItemList();
134 + schema.add(new SchemaField("lower"));
138 diff -Naur pig-original/src/com/yahoo/pig/data/Tuple.java pig-galago/src/com/yahoo/pig/data/Tuple.java
139 --- pig-original/src/com/yahoo/pig/data/Tuple.java 2007-04-05 11:24:35.000000000 -0400
140 +++ pig-galago/src/com/yahoo/pig/data/Tuple.java 2007-09-04 15:38:01.000000000 -0400
142 public void readFields(DataInput in) throws IOException {
143 // nuke the old contents of the tuple
144 fields = new ArrayList<Datum>();
145 - byte[] b = new byte[1];
146 - in.readFully(b); // Skip the 'TUPLE'
147 + in.readByte(); // Skip the 'TUPLE'
153 private static void readTuple(Tuple ret, DataInput in) throws IOException {
154 int size = decodeInt(in);
155 - byte[] b = new byte[1];
156 for (int i = 0, n = size; i < n; i++) {
159 + byte b = in.readByte();
162 ret.fields.add(readTuple(in));
164 diff -Naur pig-original/src/com/yahoo/pig/impl/eval/EvalItemList.java pig-galago/src/com/yahoo/pig/impl/eval/EvalItemList.java
165 --- pig-original/src/com/yahoo/pig/impl/eval/EvalItemList.java 2007-04-05 11:24:35.000000000 -0400
166 +++ pig-galago/src/com/yahoo/pig/impl/eval/EvalItemList.java 2007-09-06 13:22:37.000000000 -0400
168 //Since potentially can return without filling output, mark output as stale
169 //the exec method of CrossProductItem will mark output as not stale
170 output.markStale(true);
171 - while (pendingCrossProducts.peek().isReady()){
172 + while (pendingCrossProducts.size() > 0 && pendingCrossProducts.peek().isReady()){
173 pendingCrossProducts.remove().exec();
176 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/Driver.java pig-galago/src/com/yahoo/pig/impl/galago/Driver.java
177 --- pig-original/src/com/yahoo/pig/impl/galago/Driver.java 1969-12-31 19:00:00.000000000 -0500
178 +++ pig-galago/src/com/yahoo/pig/impl/galago/Driver.java 2007-09-11 14:52:10.000000000 -0400
183 + * September 5, 2007 -- Trevor Strohman
185 + * BSD License (http://www.galagosearch.org/license)
188 +package com.yahoo.pig.impl.galago;
190 +import com.yahoo.pig.PigServer;
191 +import com.yahoo.pig.PigServer.ExecType;
192 +import java.io.BufferedReader;
193 +import java.io.FileInputStream;
194 +import java.io.FileNotFoundException;
195 +import java.io.FileReader;
196 +import java.io.IOException;
202 +public class Driver {
203 + public static void main( String[] args ) throws FileNotFoundException, IOException, Exception {
204 + PigServer server = new PigServer( ExecType.GALAGO );
205 + BufferedReader reader = new BufferedReader( new FileReader( args[0] ) );
208 + if( args.length != 3 ) {
209 + System.err.println( "usage: pigScriptName outputVariable outputFilename" );
213 + while( (line = reader.readLine()) != null ) {
215 + if( line.startsWith( "#" ) ) {
220 + server.registerQuery( line );
221 + } catch( Exception e ) {
222 + throw new Exception( "Problem in query line: " + line, e );
227 + String outName = args[1];
228 + String outputFilename = args[2];
230 + server.store( outName, outputFilename );
233 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/EvalTuples.java pig-galago/src/com/yahoo/pig/impl/galago/EvalTuples.java
234 --- pig-original/src/com/yahoo/pig/impl/galago/EvalTuples.java 1969-12-31 19:00:00.000000000 -0500
235 +++ pig-galago/src/com/yahoo/pig/impl/galago/EvalTuples.java 2007-09-11 14:52:10.000000000 -0400
240 + * September 1, 2007 -- Trevor Strohman
242 + * BSD License (http://www.galagosearch.org/license)
245 +package com.yahoo.pig.impl.galago;
247 +import com.yahoo.pig.PigServer.ExecType;
248 +import com.yahoo.pig.data.DataCollector;
249 +import com.yahoo.pig.impl.PigContext;
250 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
251 +import galago.tupleflow.InputClass;
252 +import galago.tupleflow.OutputClass;
253 +import galago.tupleflow.StandardStep;
254 +import galago.tupleflow.TupleFlowParameters;
255 +import galago.tupleflow.execution.Verified;
256 +import java.io.IOException;
264 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
265 +@OutputClass(className="com.yahoo.pig.impl.galago.Tuple")
266 +public class EvalTuples extends StandardStep<Tuple, Tuple> {
267 + PigContext context = new PigContext( ExecType.GALAGO ); // probably not the right option
268 + EvalSpecPipe evalSpecPipe;
269 + DataCollector collector;
271 + public EvalTuples( TupleFlowParameters parameters ) throws IOException {
272 + evalSpecPipe = new EvalSpecPipe( context, parameters.getXML().get( "spec" ) );
273 + collector = evalSpecPipe.collector( new EvalCollector() );
276 + private class EvalCollector extends DataCollector {
277 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
281 + Tuple next = new Tuple();
283 + processor.process( next );
287 + public void process( Tuple t ) throws IOException {
291 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java pig-galago/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java
292 --- pig-original/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java 1969-12-31 19:00:00.000000000 -0500
293 +++ pig-galago/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java 2007-09-11 14:52:10.000000000 -0400
296 + * GalagoPlanCompiler
298 + * September 1, 2007 -- Trevor Strohman
300 + * BSD License (http://www.galagosearch.org/license)
303 +package com.yahoo.pig.impl.galago;
305 +import com.yahoo.pig.impl.PigContext;
306 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
307 +import com.yahoo.pig.impl.logicalLayer.LOCogroup;
308 +import com.yahoo.pig.impl.logicalLayer.LOEval;
309 +import com.yahoo.pig.impl.logicalLayer.LOLoad;
310 +import com.yahoo.pig.impl.logicalLayer.LORead;
311 +import com.yahoo.pig.impl.logicalLayer.LOStore;
312 +import com.yahoo.pig.impl.logicalLayer.LOUnion;
313 +import com.yahoo.pig.impl.logicalLayer.LogicalOperator;
314 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
315 +import com.yahoo.pig.impl.physicalLayer.PhysicalOperator;
316 +import com.yahoo.pig.impl.physicalLayer.PlanCompiler;
317 +import galago.tupleflow.Parameters;
318 +import galago.tupleflow.execution.Job;
319 +import galago.tupleflow.execution.JobConstructor.Connection;
320 +import galago.tupleflow.execution.JobConstructor.ConnectionAssignmentType;
321 +import galago.tupleflow.execution.JobConstructor.ConnectionEndPoint;
322 +import galago.tupleflow.execution.JobConstructor.ConnectionPointType;
323 +import galago.tupleflow.execution.JobConstructor.InputStep;
324 +import galago.tupleflow.execution.JobConstructor.OutputStep;
325 +import galago.tupleflow.execution.JobConstructor.Stage;
326 +import galago.tupleflow.execution.JobConstructor.StageConnectionPoint;
327 +import galago.tupleflow.execution.Step;
328 +import galago.tupleflow.Parameters.Value;
329 +import java.io.IOException;
330 +import java.util.ArrayList;
331 +import java.util.HashMap;
332 +import java.util.Map;
338 +public class GalagoPlanCompiler extends PlanCompiler {
339 + PigContext pigContext;
340 + int stageCounter = 0;
341 + Job job = new Job();
342 + HashMap<String, String> outputToStage = new HashMap<String, String>();
343 + HashMap<String, Connection> connections = new HashMap<String, Connection>();
345 + public GalagoPlanCompiler( PigContext pigContext ) {
348 + if( System.getProperty( "hashCount" ) != null )
349 + job.properties.put( "hashCount", System.getProperty("hashCount") );
352 + private Stage buildStage( String stageType ) {
353 + Stage s = new Stage();
354 + s.name = stageType + stageCounter;
360 + private StageConnectionPoint buildPoint( ConnectionPointType type, String name ) {
361 + return new StageConnectionPoint( type,
363 + "com.yahoo.pig.impl.galago.Tuple",
368 + private StageConnectionPoint buildOutput( String name ) {
369 + return buildPoint( ConnectionPointType.Output, name );
372 + private StageConnectionPoint buildInput( String name ) {
373 + return buildPoint( ConnectionPointType.Input, name );
376 + private void storeOutputLookup( String aliasName, String stageName ) {
377 + outputToStage.put( aliasName, stageName );
380 + public void addLoadStage( LOLoad load ) {
381 + Stage splitStage = buildStage( "split" + load.alias );
382 + String splitAlias = load.alias + "$split";
384 + Parameters splitParameters = new Parameters();
385 + splitParameters.add( "filename", load.filename );
387 + Step splitGeneratorStep = new Step( null, "com.yahoo.pig.impl.galago.MakeReadSplits", splitParameters );
388 + splitStage.steps.add( splitGeneratorStep );
389 + splitStage.steps.add( new OutputStep( null, splitAlias ) );
390 + splitStage.connections.put( splitAlias, buildOutput( splitAlias ) );
391 + storeOutputLookup( splitAlias, splitStage.name );
393 + Stage loadStage = buildStage( "load" + load.alias );
395 + Parameters loadParameters = new Parameters();
396 + loadParameters.add( "function", load.lf.toString() );
398 + Step inputStep = new InputStep( null, splitAlias );
399 + Step loadStep = new Step( null, "com.yahoo.pig.impl.galago.ReadTuples", loadParameters );
400 + Step storeStep = new OutputStep( null, load.alias );
402 + loadStage.steps.add( inputStep );
403 + loadStage.steps.add(loadStep);
404 + loadStage.steps.add(storeStep);
405 + loadStage.connections.put( splitAlias, buildInput( splitAlias ) );
406 + loadStage.connections.put( load.alias, buildOutput( load.alias ) );
408 + storeOutputLookup( load.alias, loadStage.name );
409 + createHashedConnection( loadStage, splitAlias );
412 + private void addEvalStage(LOEval eval) {
413 + assert eval.inputs.length == 1;
414 + LogicalOperator input = eval.inputs[0];
415 + Stage evalStage = buildStage( "eval" + input.alias );
417 + Parameters evalParameters = new Parameters();
418 + evalParameters.add( "spec", eval.spec.toString() );
420 + Step inputStep = new InputStep( null, input.alias );
421 + Step evalStep = new Step( null, "com.yahoo.pig.impl.galago.EvalTuples", evalParameters );
422 + Step outputStep = new OutputStep( null, eval.alias );
424 + evalStage.steps.add( inputStep );
425 + evalStage.steps.add( evalStep );
426 + evalStage.steps.add( outputStep );
428 + evalStage.connections.put( input.alias, buildInput( input.alias ) );
429 + evalStage.connections.put( eval.alias, buildOutput( eval.alias ) );
431 + createEachConnection( evalStage, input.alias );
432 + storeOutputLookup( eval.alias, evalStage.name );
433 + connectNowhere( evalStage, eval.alias );
436 + private ConnectionEndPoint createConnectionInput( String source ) {
437 + assert outputToStage.containsKey( source );
438 + return new ConnectionEndPoint( null, outputToStage.get( source ), source, ConnectionPointType.Input );
441 + private ConnectionEndPoint createConnectionOutput( Stage destination, String source, String[] hash ) {
442 + ConnectionAssignmentType type = (hash != null ? ConnectionAssignmentType.Each : ConnectionAssignmentType.Combined);
443 + return createConnectionOutput( destination, source, hash, type );
446 + private ConnectionEndPoint createConnectionOutput( Stage destination, String source, String[] hash, ConnectionAssignmentType type ) {
447 + return new ConnectionEndPoint( null, destination.name, source, type, ConnectionPointType.Output );
450 + private void createEachConnection( Stage destination, String source ) {
451 + createConnection( destination, source, new String[0], null, ConnectionAssignmentType.Each );
454 + private void createCombinedConnection( Stage destination, String source ) {
455 + createConnection( destination, source, new String[0], null, ConnectionAssignmentType.Combined );
458 + private void createHashedConnection( Stage destination, String source ) {
459 + createConnection( destination, source, new String[0], new String[] { "+0" }, ConnectionAssignmentType.Each );
462 + private void createConnection( Stage destination, String source, String[] order, String[] hash, ConnectionAssignmentType type ) {
463 + assert outputToStage.containsKey( source ) : destination.name + " " + source;
465 + if( !connections.containsKey(source) ) {
466 + Connection c = new Connection( null, "com.yahoo.pig.impl.galago.Tuple", order, hash, -1 );
467 + c.inputs.add( createConnectionInput( source ) );
468 + connections.put( source, c );
471 + Connection connection = connections.get( source );
472 + connection.outputs.add( createConnectionOutput( destination, source, hash, type ) );
473 + job.connections.add( connection );
476 + private void connectNowhere( Stage outputStage, String outputPoint ) {
477 + // BUGBUG: should remove this method
479 + Connection connection = new Connection( null, "com.yahoo.pig.impl.galago.Tuple", new String[0], null, -1 );
480 + connection.inputs.add( new ConnectionEndPoint( null, outputStage.name, outputPoint, ConnectionPointType.Input ) );
481 + job.connections.add( connection );
485 + private void addStoreStage(LOStore store) {
486 + Stage s = buildStage( "store" + store.alias );
487 + String inputName = store.inputs[0].alias;
488 + Parameters parameters = new Parameters();
490 + parameters.add( "filename", store.filename );
491 + parameters.add( "function", store.sf );
492 + Step inputStep = new InputStep( inputName );
493 + Step storeStep = new Step( null, "com.yahoo.pig.impl.galago.StoreTuples", parameters );
495 + s.steps.add( inputStep );
496 + s.steps.add( storeStep );
497 + s.connections.put( inputName, buildInput( inputName ) );
499 + createCombinedConnection( s, inputName );
502 + private void addGroupStage(LOCogroup group) {
503 + ArrayList<String> outputNames = new ArrayList();
505 + // Create one Map stage for each input to the COGROUP operator.
506 + // A COGROUP looks like:
507 + // COGROUP a by x, b by y, c by z
508 + // This COGROUP ends up being 3 different map stages, one for each input,
509 + // which performs the hashing, etc.
510 + // Then, there's a final Reduce stage that aligns all the similar tuples
511 + // and outputs the final tuple set.
513 + Parameters reduceParameters = new Parameters();
514 + ArrayList<Value> inputParamList = new ArrayList<Value>();
516 + for( int i=0; i<group.inputs.length; i++ ) {
517 + LogicalOperator input = group.inputs[i];
518 + GroupBySpec spec = group.specs[i];
520 + Stage inputStage = buildStage( "input" + input.alias );
521 + String outputName = "map$" + stageCounter + "$" + input.alias + "$" + group.alias;
522 + outputNames.add( outputName );
524 + inputStage.connections.put( input.alias, buildInput( input.alias ) );
525 + inputStage.connections.put( outputName, buildOutput( outputName ) );
526 + storeOutputLookup( outputName, inputStage.name );
528 + Parameters inputParameters = new Parameters();
529 + inputParameters.add( "group", spec.toString() );
531 + Step inputStep = new InputStep( null, input.alias );
532 + Step mapStep = new Step( null, "com.yahoo.pig.impl.galago.MapTuples", inputParameters );
533 + Step outputStep = new OutputStep( null, outputName );
535 + inputStage.steps.add( inputStep );
536 + inputStage.steps.add( mapStep );
537 + inputStage.steps.add( outputStep );
539 + createEachConnection( inputStage, input.alias );
541 + Value root = new Value();
542 + root.add( "name", outputName );
543 + root.add( "group", spec.toString() );
544 + inputParamList.add( root );
547 + Stage reduceStage = buildStage( "reduce" + group.alias );
548 + reduceParameters.add( "input", inputParamList );
549 + reduceParameters.add( "eval", "" );
551 + Step reduceStep = new Step( null, "com.yahoo.pig.impl.galago.JoinTuples", reduceParameters );
552 + Step outputStep = new OutputStep( null, group.alias );
554 + reduceStage.steps.add(reduceStep);
555 + reduceStage.steps.add(outputStep);
557 + // Connect the Map stages to the Reduce stage
558 + for( String outputName : outputNames ) {
559 + // This is the connection spec in the reduce stage
560 + reduceStage.connections.put( outputName, buildInput( outputName ) );
561 + // This builds the connection at the job level
562 + createHashedConnection( reduceStage, outputName );
565 + reduceStage.connections.put( group.alias, buildOutput( group.alias ) );
567 + storeOutputLookup( group.alias, reduceStage.name );
568 + connectNowhere( reduceStage, group.alias );
571 + private void addUnionStage(LOUnion lOUnion) {
572 + throw new UnsupportedOperationException("Not yet implemented");
575 + private void addReadStage( LORead read, Map queryResults ) throws IOException {
576 + IntermedResult intermediate = read.readFrom;
578 + if( !intermediate.compiled() ) {
579 + compile( intermediate.lp.root(), queryResults );
580 + intermediate.setCompiled( true );
584 + public PhysicalOperator compile(LogicalOperator lo, Map queryResults) throws IOException {
585 + // each compile stage just creates something in the job
586 + // that we can reference later.
587 + for( LogicalOperator input : lo.inputs )
588 + compile( input, queryResults );
590 + if (lo instanceof LOLoad) {
591 + addLoadStage( (LOLoad)lo );
592 + } else if(lo instanceof LORead) {
593 + LORead read = (LORead) lo;
594 + addReadStage( read, queryResults );
595 + } else if(lo instanceof LOStore) {
596 + LOStore store = (LOStore) lo;
597 + addStoreStage( store );
598 + } else if(lo instanceof LOEval) {
599 + LOEval eval = (LOEval)lo;
600 + addEvalStage( eval );
601 + } else if(lo instanceof LOCogroup) {
602 + addGroupStage( (LOCogroup)lo );
603 + } else if(lo instanceof LOUnion) {
604 + addUnionStage( (LOUnion)lo );
606 + throw new IOException( "unknown logical operator type " + lo.getClass().getName() );
609 + return new POGalago( job );
612 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/JoinTuples.java pig-galago/src/com/yahoo/pig/impl/galago/JoinTuples.java
613 --- pig-original/src/com/yahoo/pig/impl/galago/JoinTuples.java 1969-12-31 19:00:00.000000000 -0500
614 +++ pig-galago/src/com/yahoo/pig/impl/galago/JoinTuples.java 2007-09-11 14:52:10.000000000 -0400
619 + * September 3, 2007 -- Trevor Strohman
621 + * BSD License (http://www.galagosearch.org/license)
624 +package com.yahoo.pig.impl.galago;
626 +import com.yahoo.pig.PigServer.ExecType;
627 +import com.yahoo.pig.data.BagFactory;
628 +import com.yahoo.pig.data.DataBag;
629 +import com.yahoo.pig.data.DataCollector;
630 +import com.yahoo.pig.data.Datum;
631 +import com.yahoo.pig.impl.PigContext;
632 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
633 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
634 +import galago.tupleflow.ExNihiloSource;
635 +import galago.tupleflow.IncompatibleProcessorException;
636 +import galago.tupleflow.Linkage;
637 +import galago.tupleflow.OutputClass;
638 +import galago.tupleflow.Parameters.Value;
639 +import galago.tupleflow.Processor;
640 +import galago.tupleflow.Step;
641 +import galago.tupleflow.TupleFlowParameters;
642 +import galago.tupleflow.TypeReader;
643 +import galago.tupleflow.execution.Verified;
644 +import java.io.IOException;
645 +import java.util.ArrayList;
646 +import java.util.List;
647 +import java.io.File;
654 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
655 +public class JoinTuples implements ExNihiloSource<Tuple> {
657 + TypeReader[] readers;
658 + public Processor<Tuple> processor;
659 + PigContext context;
660 + DataCollector evalPipe;
661 + ArrayList<Input> inputs = new ArrayList<Input>();
663 + public class Input {
665 + public String name;
666 + public GroupBySpec group;
667 + public TypeReader<Tuple> reader;
669 + public DataBag bag;
670 + public boolean isInner;
672 + public void read() throws IOException {
673 + top = reader.read();
677 + @SuppressWarnings("unchecked")
678 + public JoinTuples(TupleFlowParameters parameters) throws IOException {
679 + context = new PigContext(ExecType.GALAGO);
680 + // BUGBUG: probably need to freeze-dry the context
681 + String evalSpec = parameters.getXML().get("eval", "");
683 + List<Value> inputs = parameters.getXML().list("input");
684 + for (int i = 0; i < inputs.size(); i++) {
685 + Input input = new Input();
686 + input.name = inputs.get(i).get("name");
687 + String groupSpec = inputs.get(i).get("group");
688 + input.group = new GroupBySpec(context, groupSpec);
689 + input.isInner = input.group.isInner;
691 + input.bag = BagFactory.getInstance().getNewBag();
692 + input.reader = parameters.getTypeReader(input.name);
693 + this.inputs.add(input);
696 + evalPipe = (new EvalSpecPipe(context, evalSpec)).collector(new JoinCollector());
699 + public class JoinCollector extends DataCollector {
701 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
705 + Tuple g = new Tuple();
707 + processor.process(g);
711 + public boolean isDone() {
712 + for (Input input : inputs) {
713 + if (input.top != null) {
721 + private void initializeTemporaryDirectory() {
722 + String temporary = System.getProperty( "java.io.tmpdir" );
723 + BagFactory.init( new File(temporary) );
726 + public void run() throws IOException {
727 + for (Input input : inputs) {
731 + initializeTemporaryDirectory();
733 + while (!isDone()) {
734 + // find the smallest tuple
735 + Datum groupName = null;
737 + for (Input input : inputs) {
738 + if (input.top != null) {
739 + Datum first = input.top.getField(0);
741 + if (groupName == null) {
743 + } else if (groupName.compareTo(first) < 0) {
749 + Tuple result = new Tuple(1 + inputs.size());
750 + result.setField(0, groupName);
752 + // now, add to the tuple
753 + for (int i = 0; i < inputs.size(); i++) {
754 + Input input = inputs.get(i);
755 + DataBag bag = BagFactory.getInstance().getNewBag();
757 + while (input.top != null && input.top.getField(0).equals(groupName)) {
758 + bag.add((com.yahoo.pig.data.Tuple) input.top.getField(1));
763 + result.setField(i + 1, bag);
766 + boolean usableTuple = true;
768 + for (int i = 0; i < inputs.size(); i++) {
769 + Input input = inputs.get(i);
771 + if (input.isInner && input.bag.isEmpty()) {
772 + usableTuple = false;
777 + evalPipe.add(result);
778 + evalPipe.add(null);
785 + public void setProcessor(Step step) throws IncompatibleProcessorException {
786 + Linkage.link(this, step);
789 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/MakeReadSplits.java pig-galago/src/com/yahoo/pig/impl/galago/MakeReadSplits.java
790 --- pig-original/src/com/yahoo/pig/impl/galago/MakeReadSplits.java 1969-12-31 19:00:00.000000000 -0500
791 +++ pig-galago/src/com/yahoo/pig/impl/galago/MakeReadSplits.java 2007-09-10 18:24:07.000000000 -0400
796 + * September 7, 2007 -- Trevor Strohman
798 + * BSD License (http://www.galagosearch.org/license)
801 +package com.yahoo.pig.impl.galago;
803 +import galago.tupleflow.ExNihiloSource;
804 +import galago.tupleflow.IncompatibleProcessorException;
805 +import galago.tupleflow.Linkage;
806 +import galago.tupleflow.OutputClass;
807 +import galago.tupleflow.Processor;
808 +import galago.tupleflow.Step;
809 +import galago.tupleflow.TupleFlowParameters;
810 +import galago.tupleflow.execution.Verified;
811 +import java.io.File;
812 +import java.util.List;
813 +import java.io.IOException;
820 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
821 +public class MakeReadSplits implements ExNihiloSource<Tuple> {
823 + public Processor<Tuple> processor;
824 + public List<String> filenames;
825 + public long increment;
827 + /** Creates a new instance of MakeReadSplits */
828 + public MakeReadSplits(TupleFlowParameters parameters) {
829 + filenames = parameters.getXML().stringList("filename");
830 + increment = parameters.getXML().get("splitLength", 10 * 1024 * 1024);
833 + public void run() throws IOException {
834 + for (String filename : filenames) {
835 + if (filename.endsWith(".gz")) {
836 + // compressed files can't be split
837 + Tuple t = new Tuple(4);
838 + t.setField(0, filename + "-" + 0 + "-" + Long.MAX_VALUE);
839 + t.setField(1, filename);
841 + t.setField(3, Long.MAX_VALUE);
843 + long fileLength = new File(filename).length();
845 + for (long start = 0; start < fileLength; start += increment) {
846 + long end = Math.min(fileLength, start + increment);
848 + Tuple t = new Tuple(4);
849 + t.setField(0, filename + "-" + start + "-" + end);
850 + t.setField(1, filename);
851 + t.setField(2, start);
852 + t.setField(3, end);
854 + processor.process(t);
862 + public void setProcessor(Step next) throws IncompatibleProcessorException {
863 + Linkage.link(this, next);
866 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/MapTuples.java pig-galago/src/com/yahoo/pig/impl/galago/MapTuples.java
867 --- pig-original/src/com/yahoo/pig/impl/galago/MapTuples.java 1969-12-31 19:00:00.000000000 -0500
868 +++ pig-galago/src/com/yahoo/pig/impl/galago/MapTuples.java 2007-09-11 14:52:10.000000000 -0400
873 + * September 3, 2007 -- Trevor Strohman
875 + * BSD License (http://www.galagosearch.org/license)
878 +package com.yahoo.pig.impl.galago;
880 +import com.yahoo.pig.PigServer.ExecType;
881 +import com.yahoo.pig.data.DataCollector;
882 +import com.yahoo.pig.data.Datum;
883 +import com.yahoo.pig.impl.PigContext;
884 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
885 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
886 +import galago.tupleflow.InputClass;
887 +import galago.tupleflow.OutputClass;
888 +import galago.tupleflow.StandardStep;
889 +import galago.tupleflow.TupleFlowParameters;
890 +import galago.tupleflow.execution.Verified;
891 +import java.io.IOException;
898 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
899 +@OutputClass(className="com.yahoo.pig.impl.galago.Tuple")
901 +public class MapTuples extends StandardStep<Tuple, Tuple> {
903 + EvalSpecPipe evalPipeSpec;
904 + DataCollector collector;
905 + PigContext context = new PigContext( ExecType.GALAGO );
907 + private class MapCollector extends DataCollector {
908 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
912 + Datum[] multGroups = group.eval(t);
914 + for( int i=0; i<multGroups.length; i++ ) {
915 + Datum key = multGroups[i];
916 + Tuple result = new Tuple();
918 + result.appendField(key);
919 + result.appendTuple(new Tuple(t));
920 + processor.process(result);
925 + public MapTuples( TupleFlowParameters parameters ) throws IOException {
926 + group = new GroupBySpec( context, parameters.getXML().get("group") );
927 + collector = new MapCollector();
930 + public void process(Tuple object) throws IOException {
931 + collector.add(object);
934 + public void close() throws IOException {
935 + collector.add(null);
939 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/POGalago.java pig-galago/src/com/yahoo/pig/impl/galago/POGalago.java
940 --- pig-original/src/com/yahoo/pig/impl/galago/POGalago.java 1969-12-31 19:00:00.000000000 -0500
941 +++ pig-galago/src/com/yahoo/pig/impl/galago/POGalago.java 2007-09-11 14:52:10.000000000 -0400
946 + * September 1, 2007 -- Trevor Strohman
948 + * BSD License (http://www.galagosearch.org/license)
951 +package com.yahoo.pig.impl.galago;
953 +import com.yahoo.pig.impl.physicalLayer.PhysicalOperator;
954 +import com.yahoo.pig.data.Tuple;
955 +import galago.tupleflow.Order;
956 +import galago.tupleflow.TypeReader;
957 +import galago.tupleflow.execution.ErrorStore;
958 +import galago.tupleflow.execution.Job;
959 +import galago.tupleflow.execution.JobExecutionContext;
960 +import galago.tupleflow.execution.LocalStageExecutor;
961 +import galago.tupleflow.execution.StageExecutor;
962 +import galago.tupleflow.execution.StageExecutorFactory;
963 +import java.io.IOException;
969 +public class POGalago extends PhysicalOperator {
971 + JobExecutionContext context;
972 + String[] orderSpec;
973 + String dataSourceName;
974 + TypeReader<com.yahoo.pig.impl.galago.Tuple> tupleReader;
976 + String outputFilename;
977 + String outputFunction;
979 + /** Creates a new instance of POGalago */
980 + public POGalago( Job job, String dataSourceName, String[] orderSpec ) {
982 + this.dataSourceName = dataSourceName;
983 + this.orderSpec = orderSpec;
986 + public POGalago( Job job ) {
990 + public Tuple getNext() throws IOException {
991 + if( tupleReader != null )
992 + return tupleReader.read();
997 + public boolean open(boolean continueFromLast) throws IOException {
998 + if( !super.open(continueFromLast) )
1001 + String temporaryStorage = System.getProperty( "gwd" );
1003 + if( temporaryStorage == null )
1004 + temporaryStorage = "/tmp/pig-galago";
1006 + String executorType = System.getProperty( "executorType" );
1008 + ErrorStore errorStore = new ErrorStore();
1009 + StageExecutor executor = StageExecutorFactory.newInstance( executorType );
1011 + job = JobExecutionContext.optimize(job);
1012 + System.out.println(job);
1013 + context = new JobExecutionContext( job, temporaryStorage, errorStore );
1014 + context.prepare();
1017 + context.run( executor );
1018 + } catch( Exception e ) {
1019 + throw (IOException) new IOException( "Problems executing the Galago job." ).initCause(e);
1022 + executor.shutdown();
1023 + System.err.println( errorStore.toString() );
1027 + public void setOutput( String filename, String function ) {
1028 + outputFilename = filename;
1029 + outputFunction = function;
1032 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/ReadTuples.java pig-galago/src/com/yahoo/pig/impl/galago/ReadTuples.java
1033 --- pig-original/src/com/yahoo/pig/impl/galago/ReadTuples.java 1969-12-31 19:00:00.000000000 -0500
1034 +++ pig-galago/src/com/yahoo/pig/impl/galago/ReadTuples.java 2007-09-11 14:52:10.000000000 -0400
1039 + * September 3, 2007 -- Trevor Strohman
1041 + * BSD License (http://www.galagosearch.org/license)
1044 +package com.yahoo.pig.impl.galago;
1046 +import com.yahoo.pig.PigServer.ExecType;
1047 +import com.yahoo.pig.StorageFunc;
1048 +import com.yahoo.pig.data.DataAtom;
1049 +import com.yahoo.pig.impl.PigContext;
1050 +import com.yahoo.pig.impl.io.FileLocalizer;
1051 +import galago.tupleflow.InputClass;
1052 +import galago.tupleflow.OutputClass;
1053 +import galago.tupleflow.StandardStep;
1054 +import galago.tupleflow.TupleFlowParameters;
1055 +import galago.tupleflow.execution.ErrorHandler;
1056 +import java.io.File;
1057 +import java.io.IOException;
1058 +import java.io.InputStream;
1059 +import java.lang.reflect.InvocationTargetException;
1060 +import java.util.zip.GZIPInputStream;
1067 +@InputClass(className = "com.yahoo.pig.impl.galago.Tuple")
1068 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
1069 +public class ReadTuples extends StandardStep<Tuple, Tuple> {
1073 + /** Creates a new instance of ReadTuples */
1074 + public ReadTuples(TupleFlowParameters parameters) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
1075 + funcSpec = parameters.getXML().get("function");
1078 + public void process(Tuple t) throws IOException {
1079 + String filename = ((DataAtom) t.getField(1)).strval();
1080 + long offset = ((DataAtom) t.getField(2)).numval().longValue();
1081 + long end = ((DataAtom) t.getField(3)).numval().longValue();
1082 + StorageFunc function = null;
1085 + function = (StorageFunc) PigContext.instantiateArgFunc(funcSpec);
1086 + } catch (Exception e) {
1087 + throw (IOException) new IOException( "Couldn't instantiate storage function" ).initCause(e);
1090 + InputStream stream = FileLocalizer.open(ExecType.LOCAL, filename);
1092 + if (filename.endsWith(".gz")) {
1093 + stream = new GZIPInputStream(stream);
1096 + stream.skip(offset);
1097 + function.bindTo(stream, offset, end);
1098 + com.yahoo.pig.data.Tuple tuple;
1100 + while ((tuple = function.getNext()) != null) {
1101 + Tuple wrapped = new Tuple();
1102 + wrapped.copyFrom(tuple);
1103 + processor.process(wrapped);
1109 + public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
1110 + if (!parameters.getXML().containsKey("function")) {
1111 + handler.addError("'function' is a required parameter of ReadTuples.");
1115 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/StoreTuples.java pig-galago/src/com/yahoo/pig/impl/galago/StoreTuples.java
1116 --- pig-original/src/com/yahoo/pig/impl/galago/StoreTuples.java 1969-12-31 19:00:00.000000000 -0500
1117 +++ pig-galago/src/com/yahoo/pig/impl/galago/StoreTuples.java 2007-09-11 14:52:10.000000000 -0400
1122 + * September 5, 2007 -- Trevor Strohman
1124 + * BSD License (http://www.galagosearch.org/license)
1127 +package com.yahoo.pig.impl.galago;
1129 +import com.yahoo.pig.StorageFunc;
1130 +import com.yahoo.pig.impl.PigContext;
1131 +import galago.tupleflow.InputClass;
1132 +import galago.tupleflow.Processor;
1133 +import galago.tupleflow.TupleFlowParameters;
1134 +import galago.tupleflow.execution.Verified;
1135 +import java.io.BufferedWriter;
1136 +import java.io.FileWriter;
1137 +import java.io.IOException;
1138 +import java.lang.reflect.InvocationTargetException;
1145 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
1146 +public class StoreTuples implements Processor<Tuple> {
1147 + BufferedWriter writer;
1148 + StorageFunc function;
1150 + /** Creates a new instance of StoreTuples */
1151 + public StoreTuples( TupleFlowParameters parameters ) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
1152 + String filename = parameters.getXML().get( "filename" );
1153 + String funcSpec = parameters.getXML().get( "function" );
1155 + function = (StorageFunc) PigContext.instantiateArgFunc(funcSpec);
1156 + writer = new BufferedWriter( new FileWriter( filename ) );
1159 + public void process( Tuple tuple ) throws IOException {
1160 + String result = tuple.toDelimitedString( "\t" );
1161 + writer.append( result );
1162 + writer.append( "\n" );
1165 + public void close() throws IOException {
1169 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/Tuple.java pig-galago/src/com/yahoo/pig/impl/galago/Tuple.java
1170 --- pig-original/src/com/yahoo/pig/impl/galago/Tuple.java 1969-12-31 19:00:00.000000000 -0500
1171 +++ pig-galago/src/com/yahoo/pig/impl/galago/Tuple.java 2007-09-11 14:52:10.000000000 -0400
1176 + * September 1, 2007 -- Trevor Strohman
1178 + * BSD License (http://www.galagosearch.org/license)
1181 +package com.yahoo.pig.impl.galago;
1183 +import galago.tupleflow.ArrayInput;
1184 +import galago.tupleflow.ArrayOutput;
1185 +import galago.tupleflow.ExNihiloSource;
1186 +import galago.tupleflow.IncompatibleProcessorException;
1187 +import galago.tupleflow.Linkage;
1188 +import galago.tupleflow.Order;
1189 +import galago.tupleflow.Processor;
1190 +import galago.tupleflow.ReaderSource;
1191 +import galago.tupleflow.Step;
1192 +import galago.tupleflow.Type;
1193 +import galago.tupleflow.TypeReader;
1194 +import java.io.EOFException;
1195 +import java.io.IOException;
1196 +import java.util.Collection;
1197 +import java.util.Comparator;
1198 +import java.util.PriorityQueue;
1204 +public class Tuple extends com.yahoo.pig.data.Tuple
1205 + implements Type<Tuple> {
1210 + public Tuple(int fieldCount) {
1211 + super(fieldCount);
1214 + public Tuple(com.yahoo.pig.data.Tuple t) {
1218 + public Order<Tuple> getOrder(String... fields) {
1219 + return new TupleOrder( fields );
1222 + public static class TupleOrder implements Order<Tuple> {
1223 + public TupleOrder( String[] orderSpec ) {
1226 + public Class<Tuple> getOrderedClass() {
1227 + return Tuple.class;
1230 + public int hash(Tuple tuple) {
1231 + return tuple.fields.get(0).hashCode();
1234 + public Comparator<Tuple> lessThan() {
1235 + return new Comparator<Tuple>() {
1236 + public int compare( Tuple one, Tuple two ) {
1237 + return one.compareTo(two);
1242 + public Comparator<Tuple> greaterThan() {
1243 + return new Comparator<Tuple>() {
1244 + public int compare( Tuple one, Tuple two ) {
1245 + return -one.compareTo(two);
1250 + public ReaderSource<Tuple> orderedCombiner( final Collection<TypeReader<Tuple>> readers, final boolean closeOnExit) {
1251 + return new TupleOrderedCombiner( readers, closeOnExit );
1254 + public static class TupleOrderedCombiner implements ReaderSource<Tuple> {
1255 + public Processor<Tuple> processor;
1256 + public Collection<TypeReader<Tuple>> readers;
1257 + public PriorityQueue<ReaderIterator> iterators;
1258 + public boolean closeOnExit;
1259 + public boolean uninitialized;
1261 + public TupleOrderedCombiner( Collection<TypeReader<Tuple>> readers, boolean closeOnExit ) {
1262 + this.readers = readers;
1263 + this.closeOnExit = closeOnExit;
1264 + this.iterators = new PriorityQueue<ReaderIterator>();
1265 + this.uninitialized = true;
1268 + public static class ReaderIterator implements Comparable<ReaderIterator> {
1270 + public TypeReader<Tuple> reader;
1272 + public ReaderIterator( TypeReader<Tuple> reader ) throws IOException {
1273 + this.reader = reader;
1277 + public boolean isDone() {
1278 + return top == null;
1281 + public Tuple read() throws IOException {
1282 + top = reader.read();
1286 + public int compareTo( ReaderIterator other ) {
1287 + return top.compareTo( other.top );
1291 + public Tuple read() throws IOException {
1292 + if( uninitialized ) {
1293 + for( TypeReader<Tuple> reader : readers ) {
1294 + ReaderIterator iterator = new ReaderIterator( reader );
1296 + if( iterator.top != null ) {
1297 + iterators.add( iterator );
1300 + uninitialized = false;
1303 + Tuple result = null;
1305 + if( iterators.size() > 0 ) {
1306 + ReaderIterator iterator = iterators.poll();
1307 + result = iterator.top;
1309 + if( iterator.read() != null )
1310 + iterators.offer( iterator );
1316 + public void run() throws IOException {
1317 + for( TypeReader<Tuple> reader : readers ) {
1318 + ReaderIterator iterator = new ReaderIterator( reader );
1320 + if( iterator.top != null ) {
1321 + iterators.add( iterator );
1325 + while( iterators.size() > 0 ) {
1326 + ReaderIterator iterator = iterators.poll();
1327 + processor.process( iterator.top );
1329 + if( iterator.read() != null ) {
1330 + iterators.offer( iterator );
1335 + processor.close();
1338 + public void setProcessor( Step step ) throws IncompatibleProcessorException {
1339 + Linkage.link(this,step);
1343 + public Processor<Tuple> orderedWriter( final ArrayOutput output ) {
1344 + return new Processor<Tuple>() {
1345 + public void process( Tuple t ) throws IOException {
1346 + t.write( output.getDataOutput() );
1349 + public void close() {}
1353 + public TypeReader<Tuple> orderedReader(final ArrayInput input) {
1354 + return new TupleOrderedReader( input );
1357 + public TypeReader<Tuple> orderedReader(ArrayInput input, int bufferSize) {
1358 + return orderedReader(input);
1361 + public static class TupleOrderedReader implements TypeReader<Tuple> {
1362 + public Processor<Tuple> processor;
1363 + public ArrayInput input;
1365 + public TupleOrderedReader( ArrayInput input ) {
1366 + this.input = input;
1369 + public Tuple read() throws IOException {
1371 + Tuple t = new Tuple();
1372 + t.readFields( input.getDataInput() );
1374 + } catch( EOFException e ) {
1379 + public void run() throws IOException {
1386 + processor.process( t );
1389 + processor.close();
1392 + public void setProcessor(Step step) throws IncompatibleProcessorException {
1393 + Linkage.link( this, step );
1398 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java
1399 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java 1969-12-31 19:00:00.000000000 -0500
1400 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java 2007-08-31 09:41:35.000000000 -0400
1402 +/* Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java */
1404 +package com.yahoo.pig.impl.logicalLayer.parser;
1406 +class JJTQueryParserState {
1407 + private java.util.Stack nodes;
1408 + private java.util.Stack marks;
1410 + private int sp; // number of nodes on stack
1411 + private int mk; // current mark
1412 + private boolean node_created;
1414 + JJTQueryParserState() {
1415 + nodes = new java.util.Stack();
1416 + marks = new java.util.Stack();
1421 + /* Determines whether the current node was actually closed and
1422 + pushed. This should only be called in the final user action of a
1424 + boolean nodeCreated() {
1425 + return node_created;
1428 + /* Call this to reinitialize the node stack. It is called
1429 + automatically by the parser's ReInit() method. */
1431 + nodes.removeAllElements();
1432 + marks.removeAllElements();
1437 + /* Returns the root node of the AST. It only makes sense to call
1438 + this after a successful parse. */
1440 + return (Node)nodes.elementAt(0);
1443 + /* Pushes a node on to the stack. */
1444 + void pushNode(Node n) {
1449 + /* Returns the node on the top of the stack, and remove it from the
1453 + mk = ((Integer)marks.pop()).intValue();
1455 + return (Node)nodes.pop();
1458 + /* Returns the node currently on the top of the stack. */
1460 + return (Node)nodes.peek();
1463 + /* Returns the number of children on the stack in the current node
1470 + void clearNodeScope(Node n) {
1474 + mk = ((Integer)marks.pop()).intValue();
1478 + void openNodeScope(Node n) {
1479 + marks.push(new Integer(mk));
1485 + /* A definite node is constructed from a specified number of
1486 + children. That number of nodes are popped from the stack and
1487 + made the children of the definite node. Then the definite node
1488 + is pushed on to the stack. */
1489 + void closeNodeScope(Node n, int num) {
1490 + mk = ((Integer)marks.pop()).intValue();
1491 + while (num-- > 0) {
1492 + Node c = popNode();
1493 + c.jjtSetParent(n);
1494 + n.jjtAddChild(c, num);
1498 + node_created = true;
1502 + /* A conditional node is constructed if its condition is true. All
1503 + the nodes that have been pushed since the node was opened are
1504 + made children of the the conditional node, which is then pushed
1505 + on to the stack. If the condition is false the node is not
1506 + constructed and they are left on the stack. */
1507 + void closeNodeScope(Node n, boolean condition) {
1509 + int a = nodeArity();
1510 + mk = ((Integer)marks.pop()).intValue();
1512 + Node c = popNode();
1513 + c.jjtSetParent(n);
1514 + n.jjtAddChild(c, a);
1518 + node_created = true;
1520 + mk = ((Integer)marks.pop()).intValue();
1521 + node_created = false;
1525 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java
1526 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java 1969-12-31 19:00:00.000000000 -0500
1527 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java 2007-08-31 09:41:35.000000000 -0400
1529 +/* Generated By:JJTree: Do not edit this line. Node.java */
1531 +package com.yahoo.pig.impl.logicalLayer.parser;
1533 +/* All AST nodes must implement this interface. It provides basic
1534 + machinery for constructing the parent and child relationships
1537 +public interface Node {
1539 + /** This method is called after the node has been made the current
1540 + node. It indicates that child nodes can now be added to it. */
1541 + public void jjtOpen();
1543 + /** This method is called after all the child nodes have been
1545 + public void jjtClose();
1547 + /** This pair of methods are used to inform the node of its
1549 + public void jjtSetParent(Node n);
1550 + public Node jjtGetParent();
1552 + /** This method tells the node to add its argument to the node's
1553 + list of children. */
1554 + public void jjtAddChild(Node n, int i);
1556 + /** This method returns a child node. The children are numbered
1557 + from zero, left to right. */
1558 + public Node jjtGetChild(int i);
1560 + /** Return the number of children the node has. */
1561 + public int jjtGetNumChildren();
1563 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java
1564 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java 1969-12-31 19:00:00.000000000 -0500
1565 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java 2007-08-31 09:41:35.000000000 -0400
1567 +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
1568 +package com.yahoo.pig.impl.logicalLayer.parser;
1571 + * This exception is thrown when parse errors are encountered.
1572 + * You can explicitly create objects of this exception type by
1573 + * calling the method generateParseException in the generated
1576 + * You can modify this class to customize your error reporting
1577 + * mechanisms so long as you retain the public fields.
1579 +public class ParseException extends Exception {
1582 + * This constructor is used by the method "generateParseException"
1583 + * in the generated parser. Calling this constructor generates
1584 + * a new object of this type with the fields "currentToken",
1585 + * "expectedTokenSequences", and "tokenImage" set. The boolean
1586 + * flag "specialConstructor" is also set to true to indicate that
1587 + * this constructor was used to create this object.
1588 + * This constructor calls its super class with the empty string
1589 + * to force the "toString" method of parent class "Throwable" to
1590 + * print the error message in the form:
1591 + * ParseException: <result of getMessage>
1593 + public ParseException(Token currentTokenVal,
1594 + int[][] expectedTokenSequencesVal,
1595 + String[] tokenImageVal
1599 + specialConstructor = true;
1600 + currentToken = currentTokenVal;
1601 + expectedTokenSequences = expectedTokenSequencesVal;
1602 + tokenImage = tokenImageVal;
1606 + * The following constructors are for use by you for whatever
1607 + * purpose you can think of. Constructing the exception in this
1608 + * manner makes the exception behave in the normal way - i.e., as
1609 + * documented in the class "Throwable". The fields "errorToken",
1610 + * "expectedTokenSequences", and "tokenImage" do not contain
1611 + * relevant information. The JavaCC generated code does not use
1612 + * these constructors.
1615 + public ParseException() {
1617 + specialConstructor = false;
1620 + public ParseException(String message) {
1622 + specialConstructor = false;
1626 + * This variable determines which constructor was used to create
1627 + * this object and thereby affects the semantics of the
1628 + * "getMessage" method (see below).
1630 + protected boolean specialConstructor;
1633 + * This is the last token that has been consumed successfully. If
1634 + * this object has been created due to a parse error, the token
1635 + * followng this token will (therefore) be the first error token.
1637 + public Token currentToken;
1640 + * Each entry in this array is an array of integers. Each array
1641 + * of integers represents a sequence of tokens (by their ordinal
1642 + * values) that is expected at this point of the parse.
1644 + public int[][] expectedTokenSequences;
1647 + * This is a reference to the "tokenImage" array of the generated
1648 + * parser within which the parse error occurred. This array is
1649 + * defined in the generated ...Constants interface.
1651 + public String[] tokenImage;
1654 + * This method has the standard behavior when this object has been
1655 + * created using the standard constructors. Otherwise, it uses
1656 + * "currentToken" and "expectedTokenSequences" to generate a parse
1657 + * error message and returns it. If this object has been created
1658 + * due to a parse error, and you do not catch it (it gets thrown
1659 + * from the parser), then this method is called during the printing
1660 + * of the final stack trace, and hence the correct error message
1663 + public String getMessage() {
1664 + if (!specialConstructor) {
1665 + return super.getMessage();
1667 + StringBuffer expected = new StringBuffer();
1669 + for (int i = 0; i < expectedTokenSequences.length; i++) {
1670 + if (maxSize < expectedTokenSequences[i].length) {
1671 + maxSize = expectedTokenSequences[i].length;
1673 + for (int j = 0; j < expectedTokenSequences[i].length; j++) {
1674 + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
1676 + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
1677 + expected.append("...");
1679 + expected.append(eol).append(" ");
1681 + String retval = "Encountered \"";
1682 + Token tok = currentToken.next;
1683 + for (int i = 0; i < maxSize; i++) {
1684 + if (i != 0) retval += " ";
1685 + if (tok.kind == 0) {
1686 + retval += tokenImage[0];
1689 + retval += add_escapes(tok.image);
1692 + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
1693 + retval += "." + eol;
1694 + if (expectedTokenSequences.length == 1) {
1695 + retval += "Was expecting:" + eol + " ";
1697 + retval += "Was expecting one of:" + eol + " ";
1699 + retval += expected.toString();
1704 + * The end of line string for this machine.
1706 + protected String eol = System.getProperty("line.separator", "\n");
1709 + * Used to convert raw characters to their escaped version
1710 + * when these raw version cannot be used as part of an ASCII
1713 + protected String add_escapes(String str) {
1714 + StringBuffer retval = new StringBuffer();
1716 + for (int i = 0; i < str.length(); i++) {
1717 + switch (str.charAt(i))
1722 + retval.append("\\b");
1725 + retval.append("\\t");
1728 + retval.append("\\n");
1731 + retval.append("\\f");
1734 + retval.append("\\r");
1737 + retval.append("\\\"");
1740 + retval.append("\\\'");
1743 + retval.append("\\\\");
1746 + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
1747 + String s = "0000" + Integer.toString(ch, 16);
1748 + retval.append("\\u" + s.substring(s.length() - 4, s.length()));
1750 + retval.append(ch);
1755 + return retval.toString();
1759 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java
1760 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java 1969-12-31 19:00:00.000000000 -0500
1761 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java 2007-08-31 09:41:35.000000000 -0400
1763 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParser.java */
1764 +package com.yahoo.pig.impl.logicalLayer.parser;
1766 +import java.util.*;
1767 +import java.lang.reflect.*;
1768 +import com.yahoo.pig.impl.logicalLayer.*;
1769 +import com.yahoo.pig.impl.eval.*;
1770 +import com.yahoo.pig.impl.eval.func.*;
1771 +import com.yahoo.pig.impl.eval.groupby.*;
1772 +import com.yahoo.pig.impl.eval.filter.*;
1773 +import com.yahoo.pig.impl.eval.window.*;
1774 +import com.yahoo.pig.impl.eval.sad.*;
1775 +import com.yahoo.pig.impl.logicalLayer.schema.*;
1776 +import com.yahoo.pig.*;
1777 +import com.yahoo.pig.impl.PigContext;
1778 +import com.yahoo.pig.PigServer.ExecType;
1779 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
1780 +import com.yahoo.pig.impl.io.FileLocalizer;
1781 +import com.yahoo.pig.builtin.*;
1782 +public class QueryParser/*@bgen(jjtree)*/implements QueryParserTreeConstants, QueryParserConstants {/*@bgen(jjtree)*/
1783 + protected JJTQueryParserState jjtree = new JJTQueryParserState();private PigContext pigContext;
1784 + private Map<String, IntermedResult> aliases;
1786 + public QueryParser(InputStream in, PigContext pigContext, Map aliases) {
1788 + this.pigContext = pigContext;
1789 + this.aliases = aliases;
1792 + public class EvalSpecPipeAndSchema{
1793 + EvalSpecPipe pipe;
1794 + SchemaItemList schema;
1797 + public class CogroupInput {
1798 + public LogicalOperator op;
1799 + public GroupBySpec spec;
1802 + static String unquote(String s) {
1803 + return s.substring(1, s.length()-1);
1806 + static int undollar(String s) {
1807 + return Integer.parseInt(s.substring(1, s.length()));
1810 + NestableEvalItem newFuncEvalItem(EvalFunc func, EvalItemList args) throws ParseException {
1811 + if (func instanceof AtomEvalFunc) return new AtomFuncEvalItem(pigContext, (AtomEvalFunc) func, args);
1812 + else if (func instanceof TupleEvalFunc) return new TupleFuncEvalItem(pigContext, (TupleEvalFunc) func, args);
1813 + else if (func instanceof BagEvalFunc) return new BagFuncEvalItem(pigContext, (BagEvalFunc) func, args);
1814 + else throw new ParseException("Error: unknown Eval Function type: " + func.getClass().getName());
1818 + LogicalOperator makeLORead(String alias) throws ParseException {
1819 + if (!aliases.containsKey(alias)) throw new ParseException("Unrecognized alias: " + alias);
1821 + LORead readOp = new LORead(pigContext, aliases.get(alias));
1822 + readOp.alias = alias;
1828 + String massageFilename(String filename) throws IOException {
1829 + if (pigContext.getExecType() != ExecType.LOCAL) {
1830 + if (filename.startsWith(FileLocalizer.LOCAL_PREFIX)) {
1831 + filename = FileLocalizer.hadoopify(filename);
1833 + if (filename.startsWith(FileLocalizer.HADOOP_PREFIX)) {
1834 + filename = filename.substring(FileLocalizer.HADOOP_PREFIX.length());
1842 + LogicalOperator parseCogroup(ArrayList<CogroupInput> gis) throws ParseException{
1843 + int n = gis.size();
1845 + LogicalOperator[] los = new LogicalOperator[n];
1846 + GroupBySpec[] specs = new GroupBySpec[n];
1848 + for (int i = 0; i < n ; i++){
1850 + CogroupInput gi = gis.get(i);
1852 + specs[i] = gi.spec;
1855 + return new LOCogroup(pigContext, los, specs);
1859 + LogicalOperator rewriteCross(ArrayList<LogicalOperator> inputs) throws IOException, ParseException{
1860 + ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
1861 + Iterator<LogicalOperator> iter = inputs.iterator();
1862 + int n = inputs.size();
1864 + EvalSpecPipe pipe = new EvalSpecPipe(pigContext);
1865 + EvalItemList list = new EvalItemList(pigContext);
1867 + for (int i=0; i< n; i++){
1869 + CogroupInput gi = new CogroupInput();
1872 + gi.op = inputs.get(i);
1873 + EvalItemList itemList = new EvalItemList(pigContext);
1874 + itemList.add(new ConstEvalItem(pigContext, n+""));
1875 + itemList.add(new ConstEvalItem(pigContext, i+""));
1876 + gi.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFCross.class.getName()), itemList, false);
1878 + ColEvalItem item = new ColEvalItem(pigContext, i+1);
1879 + EvalItemList subSpec = new EvalItemList(pigContext);
1880 + subSpec.add(new StarEvalItem(pigContext));
1881 + item.subColSpec = subSpec;
1886 + return new LOEval(pigContext, parseCogroup(gis),pipe);
1889 + LOLoad getDefaultLoadOperator(boolean continuous, String filename) throws IOException{
1891 + String[] args = null;
1894 + args = new String[2];
1899 + StorageFunc loadFunc = (StorageFunc) pigContext.getUDF(PigStorage.class.getName());
1900 + return new LOLoad(pigContext, massageFilename(filename), loadFunc, args);
1903 + void assertAtomic(EvalItem item, boolean desiredAtomic) throws ParseException{
1904 + Boolean isAtomic = null;
1905 + if (item instanceof ConstEvalItem || item instanceof AtomFuncEvalItem)
1907 + else if (item instanceof FuncEvalItem)
1910 + if (isAtomic != null && isAtomic != desiredAtomic){
1911 + if (desiredAtomic)
1912 + throw new ParseException("Atomic field expected but found non-atomic field");
1914 + throw new ParseException("Non-atomic field expected but found atomic field");
1918 + EvalItem copyItemAndAddSpec(EvalItem item, EvalSpec spec) throws ParseException{
1919 + assertAtomic(item,false);
1920 + item = item.copy();
1921 + if (!(item instanceof NestableEvalItem))
1922 + throw new ParseException("Internal Error: Cannot add spec to non-nestable field.");
1923 + NestableEvalItem nestableItem = (NestableEvalItem)item;
1924 + EvalSpecPipe specPipe = nestableItem.nestedEval;
1925 + nestableItem.addNestedEvalSpec(spec);
1929 +// Parse is the Starting function.
1930 + final public LogicalPlan Parse() throws ParseException {
1931 + /*@bgen(jjtree) Parse */
1932 + SimpleNode jjtn000 = new SimpleNode(JJTPARSE);
1933 + boolean jjtc000 = true;
1934 + jjtree.openNodeScope(jjtn000);LogicalOperator root; Token t1;
1937 + t1 = jj_consume_token(IDENTIFIER);
1938 + jj_consume_token(52);
1940 + jj_consume_token(53);
1941 + root.alias = t1.image;
1943 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1954 + jj_consume_token(53);
1957 + jj_la1[0] = jj_gen;
1958 + jj_consume_token(-1);
1959 + throw new ParseException();
1962 + jjtree.closeNodeScope(jjtn000, true);
1964 + {if (true) return new LogicalPlan(root, pigContext);}
1965 + } catch (Throwable jjte000) {
1967 + jjtree.clearNodeScope(jjtn000);
1972 + if (jjte000 instanceof RuntimeException) {
1973 + {if (true) throw (RuntimeException)jjte000;}
1975 + if (jjte000 instanceof ParseException) {
1976 + {if (true) throw (ParseException)jjte000;}
1978 + {if (true) throw (Error)jjte000;}
1981 + jjtree.closeNodeScope(jjtn000, true);
1984 + throw new Error("Missing return statement in function");
1987 + final public LogicalOperator Expr() throws ParseException {
1988 + /*@bgen(jjtree) Expr */
1989 + SimpleNode jjtn000 = new SimpleNode(JJTEXPR);
1990 + boolean jjtc000 = true;
1991 + jjtree.openNodeScope(jjtn000);LogicalOperator op; SchemaItemList schema;
1993 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1996 + op = NestedExpr();
1997 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1999 + jj_consume_token(AS);
2000 + schema = AsClause();
2004 + jj_la1[1] = jj_gen;
2018 + jj_la1[2] = jj_gen;
2019 + jj_consume_token(-1);
2020 + throw new ParseException();
2022 + jjtree.closeNodeScope(jjtn000, true);
2024 + {if (true) return op;}
2025 + } catch (Throwable jjte000) {
2027 + jjtree.clearNodeScope(jjtn000);
2032 + if (jjte000 instanceof RuntimeException) {
2033 + {if (true) throw (RuntimeException)jjte000;}
2035 + if (jjte000 instanceof ParseException) {
2036 + {if (true) throw (ParseException)jjte000;}
2038 + {if (true) throw (Error)jjte000;}
2041 + jjtree.closeNodeScope(jjtn000, true);
2044 + throw new Error("Missing return statement in function");
2047 + final public LogicalOperator NestedExpr() throws ParseException {
2048 + /*@bgen(jjtree) NestedExpr */
2049 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDEXPR);
2050 + boolean jjtc000 = true;
2051 + jjtree.openNodeScope(jjtn000);LogicalOperator op;
2053 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2058 + jj_la1[3] = jj_gen;
2060 + jj_consume_token(54);
2061 + op = NestedExpr();
2062 + jj_consume_token(55);
2064 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2066 + jj_consume_token(54);
2068 + jj_consume_token(55);
2071 + jj_la1[4] = jj_gen;
2072 + jj_consume_token(-1);
2073 + throw new ParseException();
2077 + jjtree.closeNodeScope(jjtn000, true);
2079 + {if (true) return op;}
2080 + } catch (Throwable jjte000) {
2082 + jjtree.clearNodeScope(jjtn000);
2087 + if (jjte000 instanceof RuntimeException) {
2088 + {if (true) throw (RuntimeException)jjte000;}
2090 + if (jjte000 instanceof ParseException) {
2091 + {if (true) throw (ParseException)jjte000;}
2093 + {if (true) throw (Error)jjte000;}
2096 + jjtree.closeNodeScope(jjtn000, true);
2099 + throw new Error("Missing return statement in function");
2102 +// A reference to an alias
2103 + final public LogicalOperator Alias() throws ParseException {
2104 + /*@bgen(jjtree) Alias */
2105 + SimpleNode jjtn000 = new SimpleNode(JJTALIAS);
2106 + boolean jjtc000 = true;
2107 + jjtree.openNodeScope(jjtn000);Token t1; LogicalOperator op;
2109 + t1 = jj_consume_token(IDENTIFIER);
2110 + jjtree.closeNodeScope(jjtn000, true);
2112 + op = makeLORead(t1.image);
2113 + {if (true) return op;}
2116 + jjtree.closeNodeScope(jjtn000, true);
2119 + throw new Error("Missing return statement in function");
2122 + final public LogicalOperator BaseExpr() throws ParseException {
2123 + /*@bgen(jjtree) BaseExpr */
2124 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEXPR);
2125 + boolean jjtc000 = true;
2126 + jjtree.openNodeScope(jjtn000);LogicalOperator op; SchemaItemList schema; Token t1, t2;
2128 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2130 + jj_consume_token(LOAD);
2131 + op = LoadClause();
2132 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2134 + jj_consume_token(AS);
2135 + schema = AsClause();
2139 + jj_la1[5] = jj_gen;
2145 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2147 + jj_consume_token(GROUP);
2150 + jj_consume_token(COGROUP);
2153 + jj_la1[6] = jj_gen;
2154 + jj_consume_token(-1);
2155 + throw new ParseException();
2157 + op = CogroupClause();
2160 + jj_consume_token(FILTER);
2161 + op = FilterClause();
2164 + jj_consume_token(CROSS);
2165 + op = CrossClause();
2168 + jj_consume_token(UNION);
2169 + op = UnionClause();
2172 + jj_consume_token(FOREACH);
2173 + op = ForEachClause();
2176 + jj_la1[7] = jj_gen;
2177 + jj_consume_token(-1);
2178 + throw new ParseException();
2180 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2182 + jj_consume_token(PARALLEL);
2183 + t2 = jj_consume_token(NUMBER);
2184 + op.requestedParallelism = Integer.parseInt(t2.image);
2187 + jj_la1[8] = jj_gen;
2190 + jjtree.closeNodeScope(jjtn000, true);
2192 + {if (true) return op;}
2193 + } catch (Throwable jjte000) {
2195 + jjtree.clearNodeScope(jjtn000);
2200 + if (jjte000 instanceof RuntimeException) {
2201 + {if (true) throw (RuntimeException)jjte000;}
2203 + if (jjte000 instanceof ParseException) {
2204 + {if (true) throw (ParseException)jjte000;}
2206 + {if (true) throw (Error)jjte000;}
2209 + jjtree.closeNodeScope(jjtn000, true);
2212 + throw new Error("Missing return statement in function");
2215 + final public LogicalOperator LoadClause() throws ParseException {
2216 + /*@bgen(jjtree) LoadClause */
2217 + SimpleNode jjtn000 = new SimpleNode(JJTLOADCLAUSE);
2218 + boolean jjtc000 = true;
2219 + jjtree.openNodeScope(jjtn000);Token t1, t2; String filename; StorageFunc loadFunc = null;
2220 + ArrayList<String> loadParams = new ArrayList<String>(); LOLoad lo=null; boolean continuous=false;
2222 + t1 = jj_consume_token(QUOTEDSTRING);
2223 + filename = unquote(t1.image);
2224 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2226 + jj_consume_token(USING);
2227 + loadFunc = LoadFunction();
2228 + jj_consume_token(54);
2229 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2230 + case QUOTEDSTRING:
2231 + t2 = jj_consume_token(QUOTEDSTRING);
2232 + loadParams.add(t2.image);
2235 + jj_la1[9] = jj_gen;
2240 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2245 + jj_la1[10] = jj_gen;
2248 + jj_consume_token(56);
2249 + t2 = jj_consume_token(QUOTEDSTRING);
2250 + loadParams.add(t2.image);
2252 + jj_consume_token(55);
2253 + lo = new LOLoad(pigContext, massageFilename(filename), loadFunc, loadParams);
2256 + jj_la1[11] = jj_gen;
2259 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2260 + case CONTINUOUSLY:
2261 + jj_consume_token(CONTINUOUSLY);
2265 + jj_la1[12] = jj_gen;
2268 + jjtree.closeNodeScope(jjtn000, true);
2271 + lo = getDefaultLoadOperator(continuous,filename);
2274 + lo.setOutputType(LogicalOperator.MONOTONE);
2275 + {if (true) return lo;}
2276 + } catch (Throwable jjte000) {
2278 + jjtree.clearNodeScope(jjtn000);
2283 + if (jjte000 instanceof RuntimeException) {
2284 + {if (true) throw (RuntimeException)jjte000;}
2286 + if (jjte000 instanceof ParseException) {
2287 + {if (true) throw (ParseException)jjte000;}
2289 + {if (true) throw (Error)jjte000;}
2292 + jjtree.closeNodeScope(jjtn000, true);
2295 + throw new Error("Missing return statement in function");
2298 + final public LogicalOperator FilterClause() throws ParseException {
2299 + /*@bgen(jjtree) FilterClause */
2300 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERCLAUSE);
2301 + boolean jjtc000 = true;
2302 + jjtree.openNodeScope(jjtn000);Cond cond; LogicalOperator input;
2304 + input = NestedExpr();
2305 + jj_consume_token(BY);
2306 + cond = PCond(input.outputSchema(),null);
2307 + jjtree.closeNodeScope(jjtn000, true);
2309 + EvalSpecPipe specPipe = new EvalSpecPipe(pigContext);
2310 + specPipe.add(new FilterSpec(cond));
2311 + {if (true) return new LOEval(pigContext, input, specPipe);}
2312 + } catch (Throwable jjte000) {
2314 + jjtree.clearNodeScope(jjtn000);
2319 + if (jjte000 instanceof RuntimeException) {
2320 + {if (true) throw (RuntimeException)jjte000;}
2322 + if (jjte000 instanceof ParseException) {
2323 + {if (true) throw (ParseException)jjte000;}
2325 + {if (true) throw (Error)jjte000;}
2328 + jjtree.closeNodeScope(jjtn000, true);
2331 + throw new Error("Missing return statement in function");
2334 + final public Cond PCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2335 + /*@bgen(jjtree) PCond */
2336 + SimpleNode jjtn000 = new SimpleNode(JJTPCOND);
2337 + boolean jjtc000 = true;
2338 + jjtree.openNodeScope(jjtn000);Cond cond = null;
2340 + cond = POrCond(over,pipes);
2341 + jjtree.closeNodeScope(jjtn000, true);
2343 + {if (true) return cond;}
2344 + } catch (Throwable jjte000) {
2346 + jjtree.clearNodeScope(jjtn000);
2351 + if (jjte000 instanceof RuntimeException) {
2352 + {if (true) throw (RuntimeException)jjte000;}
2354 + if (jjte000 instanceof ParseException) {
2355 + {if (true) throw (ParseException)jjte000;}
2357 + {if (true) throw (Error)jjte000;}
2360 + jjtree.closeNodeScope(jjtn000, true);
2363 + throw new Error("Missing return statement in function");
2366 + final public Cond POrCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2367 + /*@bgen(jjtree) POrCond */
2368 + SimpleNode jjtn000 = new SimpleNode(JJTPORCOND);
2369 + boolean jjtc000 = true;
2370 + jjtree.openNodeScope(jjtn000);Cond cond; List<Cond> cList = new ArrayList<Cond>();
2372 + cond = PAndCond(over,pipes);
2376 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2381 + jj_la1[13] = jj_gen;
2384 + jj_consume_token(OR);
2385 + cond = PAndCond(over,pipes);
2388 + jjtree.closeNodeScope(jjtn000, true);
2390 + if (cList.size()==1)
2391 + {if (true) return cond;}
2393 + {if (true) return new OrCond(cList);}
2394 + } catch (Throwable jjte000) {
2396 + jjtree.clearNodeScope(jjtn000);
2401 + if (jjte000 instanceof RuntimeException) {
2402 + {if (true) throw (RuntimeException)jjte000;}
2404 + if (jjte000 instanceof ParseException) {
2405 + {if (true) throw (ParseException)jjte000;}
2407 + {if (true) throw (Error)jjte000;}
2410 + jjtree.closeNodeScope(jjtn000, true);
2413 + throw new Error("Missing return statement in function");
2416 + final public Cond PAndCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2417 + /*@bgen(jjtree) PAndCond */
2418 + SimpleNode jjtn000 = new SimpleNode(JJTPANDCOND);
2419 + boolean jjtc000 = true;
2420 + jjtree.openNodeScope(jjtn000);Cond cond = null; List<Cond> cList = new ArrayList<Cond>();
2422 + cond = PUnaryCond(over,pipes);
2426 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2431 + jj_la1[14] = jj_gen;
2434 + jj_consume_token(AND);
2435 + cond = PUnaryCond(over,pipes);
2438 + jjtree.closeNodeScope(jjtn000, true);
2440 + if (cList.size()==1)
2441 + {if (true) return cond;}
2443 + {if (true) return new AndCond(cList);}
2444 + } catch (Throwable jjte000) {
2446 + jjtree.clearNodeScope(jjtn000);
2451 + if (jjte000 instanceof RuntimeException) {
2452 + {if (true) throw (RuntimeException)jjte000;}
2454 + if (jjte000 instanceof ParseException) {
2455 + {if (true) throw (ParseException)jjte000;}
2457 + {if (true) throw (Error)jjte000;}
2460 + jjtree.closeNodeScope(jjtn000, true);
2463 + throw new Error("Missing return statement in function");
2466 + final public Cond PUnaryCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2467 + /*@bgen(jjtree) PUnaryCond */
2468 + SimpleNode jjtn000 = new SimpleNode(JJTPUNARYCOND);
2469 + boolean jjtc000 = true;
2470 + jjtree.openNodeScope(jjtn000);Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;
2472 + if (jj_2_3(2147483647)) {
2473 + jj_consume_token(54);
2474 + cond = PCond(over,pipes);
2475 + jj_consume_token(55);
2476 + } else if (jj_2_4(2147483647)) {
2477 + func = FilterFunction();
2478 + jj_consume_token(54);
2479 + args = EvalArgs(over,pipes);
2480 + jj_consume_token(55);
2481 + cond = new FuncCond(func, args);
2483 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2485 + cond = PNotCond(over,pipes);
2488 + jj_la1[15] = jj_gen;
2489 + if (jj_2_5(2147483647)) {
2490 + c1 = InfixExpr(over,pipes);
2491 + t1 = jj_consume_token(FILTEROP);
2492 + c2 = InfixExpr(over,pipes);
2493 + cond = new CompCond(c1, t1.image, c2);
2494 + } else if (jj_2_6(2)) {
2495 + c1 = InfixExpr(over,pipes);
2496 + jj_consume_token(MATCHES);
2497 + t1 = jj_consume_token(QUOTEDSTRING);
2498 + cond = new RegexpCond(c1, unquote(t1.image));
2500 + jj_consume_token(-1);
2501 + throw new ParseException();
2505 + jjtree.closeNodeScope(jjtn000, true);
2507 + {if (true) return cond;}
2508 + } catch (Throwable jjte000) {
2510 + jjtree.clearNodeScope(jjtn000);
2515 + if (jjte000 instanceof RuntimeException) {
2516 + {if (true) throw (RuntimeException)jjte000;}
2518 + if (jjte000 instanceof ParseException) {
2519 + {if (true) throw (ParseException)jjte000;}
2521 + {if (true) throw (Error)jjte000;}
2524 + jjtree.closeNodeScope(jjtn000, true);
2527 + throw new Error("Missing return statement in function");
2530 + final public Cond PNotCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2531 + /*@bgen(jjtree) PNotCond */
2532 + SimpleNode jjtn000 = new SimpleNode(JJTPNOTCOND);
2533 + boolean jjtc000 = true;
2534 + jjtree.openNodeScope(jjtn000);Cond c1;
2536 + jj_consume_token(NOT);
2537 + c1 = PUnaryCond(over,pipes);
2538 + jjtree.closeNodeScope(jjtn000, true);
2540 + {if (true) return new NotCond(c1);}
2541 + } catch (Throwable jjte000) {
2543 + jjtree.clearNodeScope(jjtn000);
2548 + if (jjte000 instanceof RuntimeException) {
2549 + {if (true) throw (RuntimeException)jjte000;}
2551 + if (jjte000 instanceof ParseException) {
2552 + {if (true) throw (ParseException)jjte000;}
2554 + {if (true) throw (Error)jjte000;}
2557 + jjtree.closeNodeScope(jjtn000, true);
2560 + throw new Error("Missing return statement in function");
2563 + final public LogicalOperator CogroupClause() throws ParseException {
2564 + /*@bgen(jjtree) CogroupClause */
2565 + SimpleNode jjtn000 = new SimpleNode(JJTCOGROUPCLAUSE);
2566 + boolean jjtc000 = true;
2567 + jjtree.openNodeScope(jjtn000);CogroupInput gi; ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
2573 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2578 + jj_la1[16] = jj_gen;
2581 + jj_consume_token(56);
2585 + jjtree.closeNodeScope(jjtn000, true);
2587 + {if (true) return parseCogroup(gis);}
2588 + } catch (Throwable jjte000) {
2590 + jjtree.clearNodeScope(jjtn000);
2595 + if (jjte000 instanceof RuntimeException) {
2596 + {if (true) throw (RuntimeException)jjte000;}
2598 + if (jjte000 instanceof ParseException) {
2599 + {if (true) throw (ParseException)jjte000;}
2601 + {if (true) throw (Error)jjte000;}
2604 + jjtree.closeNodeScope(jjtn000, true);
2607 + throw new Error("Missing return statement in function");
2610 + final public CogroupInput GroupItem() throws ParseException {
2611 + /*@bgen(jjtree) GroupItem */
2612 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPITEM);
2613 + boolean jjtc000 = true;
2614 + jjtree.openNodeScope(jjtn000);LogicalOperator op; GroupFunc groupFunc; CogroupInput cogroupInput = new CogroupInput();
2616 + cogroupInput.op = NestedExpr();
2617 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2619 + jj_consume_token(BY);
2620 + cogroupInput.spec = GroupByExpr(cogroupInput.op.outputSchema());
2623 + jj_consume_token(ALL);
2624 + cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAll.class.getName()), new EvalItemList(pigContext), false);
2627 + jj_consume_token(ANY);
2628 + cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAny.class.getName()), new EvalItemList(pigContext), false);
2631 + jj_la1[17] = jj_gen;
2632 + jj_consume_token(-1);
2633 + throw new ParseException();
2635 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2638 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2640 + jj_consume_token(INNER);
2641 + cogroupInput.spec.isInner = true;
2644 + jj_consume_token(OUTER);
2647 + jj_la1[18] = jj_gen;
2648 + jj_consume_token(-1);
2649 + throw new ParseException();
2653 + jj_la1[19] = jj_gen;
2656 + jjtree.closeNodeScope(jjtn000, true);
2658 + {if (true) return cogroupInput;}
2659 + } catch (Throwable jjte000) {
2661 + jjtree.clearNodeScope(jjtn000);
2666 + if (jjte000 instanceof RuntimeException) {
2667 + {if (true) throw (RuntimeException)jjte000;}
2669 + if (jjte000 instanceof ParseException) {
2670 + {if (true) throw (ParseException)jjte000;}
2672 + {if (true) throw (Error)jjte000;}
2675 + jjtree.closeNodeScope(jjtn000, true);
2678 + throw new Error("Missing return statement in function");
2681 + final public GroupBySpec GroupByExpr(SchemaItem over) throws ParseException {
2682 + /*@bgen(jjtree) GroupByExpr */
2683 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYEXPR);
2684 + boolean jjtc000 = true;
2685 + jjtree.openNodeScope(jjtn000);Token t1; GroupBySpec spec = null; EvalItem projItem = null; EvalItemList proj = null; String s; GroupFunc func = null;
2688 + func = GroupFunction();
2689 + jj_consume_token(54);
2690 + proj = SimpleProjOrEmpty(over);
2691 + jj_consume_token(55);
2692 + spec = new GroupBySpec(pigContext, func, proj, false);
2694 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2698 + case QUOTEDSTRING:
2701 + proj = BracketedSimpleProj(over);
2702 + spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFTupleNoop.class.getName()), proj, false);
2705 + jj_la1[20] = jj_gen;
2706 + jj_consume_token(-1);
2707 + throw new ParseException();
2710 + jjtree.closeNodeScope(jjtn000, true);
2712 + {if (true) return spec;}
2713 + } catch (Throwable jjte000) {
2715 + jjtree.clearNodeScope(jjtn000);
2720 + if (jjte000 instanceof RuntimeException) {
2721 + {if (true) throw (RuntimeException)jjte000;}
2723 + if (jjte000 instanceof ParseException) {
2724 + {if (true) throw (ParseException)jjte000;}
2726 + {if (true) throw (Error)jjte000;}
2729 + jjtree.closeNodeScope(jjtn000, true);
2732 + throw new Error("Missing return statement in function");
2735 +//Used in serialization and deserialization
2736 + final public GroupBySpec GroupBySpec() throws ParseException {
2737 + /*@bgen(jjtree) GroupBySpec */
2738 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYSPEC);
2739 + boolean jjtc000 = true;
2740 + jjtree.openNodeScope(jjtn000);GroupBySpec spec = null;
2742 + spec = GroupByExpr(null);
2743 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2746 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2748 + jj_consume_token(INNER);
2749 + spec.isInner = true;
2752 + jj_consume_token(OUTER);
2755 + jj_la1[21] = jj_gen;
2756 + jj_consume_token(-1);
2757 + throw new ParseException();
2761 + jj_la1[22] = jj_gen;
2764 + jjtree.closeNodeScope(jjtn000, true);
2766 + {if (true) return spec;}
2767 + } catch (Throwable jjte000) {
2769 + jjtree.clearNodeScope(jjtn000);
2774 + if (jjte000 instanceof RuntimeException) {
2775 + {if (true) throw (RuntimeException)jjte000;}
2777 + if (jjte000 instanceof ParseException) {
2778 + {if (true) throw (ParseException)jjte000;}
2780 + {if (true) throw (Error)jjte000;}
2783 + jjtree.closeNodeScope(jjtn000, true);
2786 + throw new Error("Missing return statement in function");
2789 + final public LogicalOperator CrossClause() throws ParseException {
2790 + /*@bgen(jjtree) CrossClause */
2791 + SimpleNode jjtn000 = new SimpleNode(JJTCROSSCLAUSE);
2792 + boolean jjtc000 = true;
2793 + jjtree.openNodeScope(jjtn000);LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();
2795 + op = NestedExpr();
2799 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2804 + jj_la1[23] = jj_gen;
2807 + jj_consume_token(56);
2808 + op = NestedExpr();
2811 + jjtree.closeNodeScope(jjtn000, true);
2813 + {if (true) return rewriteCross(inputs);}
2814 + } catch (Throwable jjte000) {
2816 + jjtree.clearNodeScope(jjtn000);
2821 + if (jjte000 instanceof RuntimeException) {
2822 + {if (true) throw (RuntimeException)jjte000;}
2824 + if (jjte000 instanceof ParseException) {
2825 + {if (true) throw (ParseException)jjte000;}
2827 + {if (true) throw (Error)jjte000;}
2830 + jjtree.closeNodeScope(jjtn000, true);
2833 + throw new Error("Missing return statement in function");
2836 + final public LogicalOperator UnionClause() throws ParseException {
2837 + /*@bgen(jjtree) UnionClause */
2838 + SimpleNode jjtn000 = new SimpleNode(JJTUNIONCLAUSE);
2839 + boolean jjtc000 = true;
2840 + jjtree.openNodeScope(jjtn000);LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();
2842 + op = NestedExpr();
2846 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2851 + jj_la1[24] = jj_gen;
2854 + jj_consume_token(56);
2855 + op = NestedExpr();
2858 + jjtree.closeNodeScope(jjtn000, true);
2860 + {if (true) return new LOUnion(pigContext, inputs);}
2861 + } catch (Throwable jjte000) {
2863 + jjtree.clearNodeScope(jjtn000);
2868 + if (jjte000 instanceof RuntimeException) {
2869 + {if (true) throw (RuntimeException)jjte000;}
2871 + if (jjte000 instanceof ParseException) {
2872 + {if (true) throw (ParseException)jjte000;}
2874 + {if (true) throw (Error)jjte000;}
2877 + jjtree.closeNodeScope(jjtn000, true);
2880 + throw new Error("Missing return statement in function");
2883 + final public LogicalOperator ForEachClause() throws ParseException {
2884 + /*@bgen(jjtree) ForEachClause */
2885 + SimpleNode jjtn000 = new SimpleNode(JJTFOREACHCLAUSE);
2886 + boolean jjtc000 = true;
2887 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema specPipeAndSchema = null; LogicalOperator input, op;
2889 + input = NestedExpr();
2890 + specPipeAndSchema = NestedBlock(input.outputSchema());
2891 + jjtree.closeNodeScope(jjtn000, true);
2893 + op = new LOEval(pigContext, input, specPipeAndSchema.pipe);
2894 + op.schema = specPipeAndSchema.schema;
2895 + {if (true) return op;}
2896 + } catch (Throwable jjte000) {
2898 + jjtree.clearNodeScope(jjtn000);
2903 + if (jjte000 instanceof RuntimeException) {
2904 + {if (true) throw (RuntimeException)jjte000;}
2906 + if (jjte000 instanceof ParseException) {
2907 + {if (true) throw (ParseException)jjte000;}
2909 + {if (true) throw (Error)jjte000;}
2912 + jjtree.closeNodeScope(jjtn000, true);
2915 + throw new Error("Missing return statement in function");
2918 + final public EvalSpecPipeAndSchema NestedBlock(SchemaItem over) throws ParseException {
2919 + /*@bgen(jjtree) NestedBlock */
2920 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDBLOCK);
2921 + boolean jjtc000 = true;
2922 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema pipeAndSchema; Map<String, EvalItem> pipes = new HashMap<String, EvalItem>();
2924 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2926 + pipeAndSchema = GenerateStatement(over,pipes);
2929 + jj_consume_token(57);
2932 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2937 + jj_la1[25] = jj_gen;
2940 + NestedCommand(over,pipes);
2941 + jj_consume_token(53);
2943 + pipeAndSchema = GenerateStatement(over,pipes);
2944 + jj_consume_token(53);
2945 + jj_consume_token(58);
2948 + jj_la1[26] = jj_gen;
2949 + jj_consume_token(-1);
2950 + throw new ParseException();
2952 + jjtree.closeNodeScope(jjtn000, true);
2954 + {if (true) return pipeAndSchema;}
2955 + } catch (Throwable jjte000) {
2957 + jjtree.clearNodeScope(jjtn000);
2962 + if (jjte000 instanceof RuntimeException) {
2963 + {if (true) throw (RuntimeException)jjte000;}
2965 + if (jjte000 instanceof ParseException) {
2966 + {if (true) throw (ParseException)jjte000;}
2968 + {if (true) throw (Error)jjte000;}
2971 + jjtree.closeNodeScope(jjtn000, true);
2974 + throw new Error("Missing return statement in function");
2977 + final public void NestedCommand(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2978 + /*@bgen(jjtree) NestedCommand */
2979 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDCOMMAND);
2980 + boolean jjtc000 = true;
2981 + jjtree.openNodeScope(jjtn000);Token t; EvalItem item;
2983 + t = jj_consume_token(IDENTIFIER);
2984 + jj_consume_token(52);
2985 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2988 + case QUOTEDSTRING:
2991 + item = InfixExpr(over,pipes);
2994 + item = NestedFilter(over,pipes);
2998 + item = NestedSortOrArrange(over,pipes);
3001 + item = NestedDistinct(over,pipes);
3004 + jj_la1[27] = jj_gen;
3005 + jj_consume_token(-1);
3006 + throw new ParseException();
3008 + jjtree.closeNodeScope(jjtn000, true);
3010 + pipes.put(t.image,item);
3011 + } catch (Throwable jjte000) {
3013 + jjtree.clearNodeScope(jjtn000);
3018 + if (jjte000 instanceof RuntimeException) {
3019 + {if (true) throw (RuntimeException)jjte000;}
3021 + if (jjte000 instanceof ParseException) {
3022 + {if (true) throw (ParseException)jjte000;}
3024 + {if (true) throw (Error)jjte000;}
3027 + jjtree.closeNodeScope(jjtn000, true);
3032 + final public EvalItem NestedFilter(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3033 + /*@bgen(jjtree) NestedFilter */
3034 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDFILTER);
3035 + boolean jjtc000 = true;
3036 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem item; SchemaItem subSchema = null;
3038 + jj_consume_token(FILTER);
3039 + item = BaseEvalItem(over,pipes);
3040 + subSchema = item.mapInputSchema(over);
3041 + jj_consume_token(BY);
3042 + cond = PCond(subSchema,null);
3043 + jjtree.closeNodeScope(jjtn000, true);
3045 + {if (true) return copyItemAndAddSpec(item,new FilterSpec(cond));}
3046 + } catch (Throwable jjte000) {
3048 + jjtree.clearNodeScope(jjtn000);
3053 + if (jjte000 instanceof RuntimeException) {
3054 + {if (true) throw (RuntimeException)jjte000;}
3056 + if (jjte000 instanceof ParseException) {
3057 + {if (true) throw (ParseException)jjte000;}
3059 + {if (true) throw (Error)jjte000;}
3062 + jjtree.closeNodeScope(jjtn000, true);
3065 + throw new Error("Missing return statement in function");
3068 + final public EvalItem NestedSortOrArrange(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3069 + /*@bgen(jjtree) NestedSortOrArrange */
3070 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDSORTORARRANGE);
3071 + boolean jjtc000 = true;
3072 + jjtree.openNodeScope(jjtn000);EvalItemList list; EvalItem item; SchemaItem subSchema = null; Token t;
3074 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3076 + t = jj_consume_token(ORDER);
3079 + t = jj_consume_token(ARRANGE);
3082 + jj_la1[28] = jj_gen;
3083 + jj_consume_token(-1);
3084 + throw new ParseException();
3086 + item = BaseEvalItem(over,pipes);
3087 + subSchema = item.mapInputSchema(over);
3088 + jj_consume_token(BY);
3089 + list = SimpleProj(subSchema);
3090 + jjtree.closeNodeScope(jjtn000, true);
3092 + {if (true) return copyItemAndAddSpec(item,new SortArrangeSpec(list,t.image.equalsIgnoreCase("arrange")));}
3093 + } catch (Throwable jjte000) {
3095 + jjtree.clearNodeScope(jjtn000);
3100 + if (jjte000 instanceof RuntimeException) {
3101 + {if (true) throw (RuntimeException)jjte000;}
3103 + if (jjte000 instanceof ParseException) {
3104 + {if (true) throw (ParseException)jjte000;}
3106 + {if (true) throw (Error)jjte000;}
3109 + jjtree.closeNodeScope(jjtn000, true);
3112 + throw new Error("Missing return statement in function");
3115 + final public EvalItem NestedDistinct(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3116 + /*@bgen(jjtree) NestedDistinct */
3117 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDDISTINCT);
3118 + boolean jjtc000 = true;
3119 + jjtree.openNodeScope(jjtn000);EvalItemList list; EvalItem item; LogicalOperator subOp = null; Token t;
3121 + jj_consume_token(DISTINCT);
3122 + item = BaseEvalItem(over,pipes);
3123 + jjtree.closeNodeScope(jjtn000, true);
3125 + list = new EvalItemList(pigContext); list.add(new StarEvalItem(pigContext));
3126 + {if (true) return copyItemAndAddSpec(item,new DistinctSpec(list));}
3127 + } catch (Throwable jjte000) {
3129 + jjtree.clearNodeScope(jjtn000);
3134 + if (jjte000 instanceof RuntimeException) {
3135 + {if (true) throw (RuntimeException)jjte000;}
3137 + if (jjte000 instanceof ParseException) {
3138 + {if (true) throw (ParseException)jjte000;}
3140 + {if (true) throw (Error)jjte000;}
3143 + jjtree.closeNodeScope(jjtn000, true);
3146 + throw new Error("Missing return statement in function");
3149 + final public EvalSpecPipeAndSchema GenerateStatement(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3150 + /*@bgen(jjtree) GenerateStatement */
3151 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATESTATEMENT);
3152 + boolean jjtc000 = true;
3153 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema pipeAndSchema = new EvalSpecPipeAndSchema(); EvalSpecPipe pipe = null; SchemaItemList schema;
3155 + jj_consume_token(GENERATE);
3156 + pipe = FlattenedGenerateItemList(over,pipes);
3157 + jjtree.closeNodeScope(jjtn000, true);
3159 + pipeAndSchema.pipe = pipe;
3160 + {if (true) return pipeAndSchema;}
3161 + } catch (Throwable jjte000) {
3163 + jjtree.clearNodeScope(jjtn000);
3168 + if (jjte000 instanceof RuntimeException) {
3169 + {if (true) throw (RuntimeException)jjte000;}
3171 + if (jjte000 instanceof ParseException) {
3172 + {if (true) throw (ParseException)jjte000;}
3174 + {if (true) throw (Error)jjte000;}
3177 + jjtree.closeNodeScope(jjtn000, true);
3180 + throw new Error("Missing return statement in function");
3183 + final public EvalSpecPipe FlattenedGenerateItemList(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3184 + /*@bgen(jjtree) FlattenedGenerateItemList */
3185 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEMLIST);
3186 + boolean jjtc000 = true;
3187 + jjtree.openNodeScope(jjtn000);EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalItemList list = new EvalItemList(pigContext); EvalItem item;
3189 + item = FlattenedGenerateItem(over,pipes);
3193 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3198 + jj_la1[29] = jj_gen;
3201 + jj_consume_token(56);
3202 + item = FlattenedGenerateItem(over,pipes);
3205 + jjtree.closeNodeScope(jjtn000, true);
3207 + pipe.add(list); {if (true) return pipe;}
3208 + } catch (Throwable jjte000) {
3210 + jjtree.clearNodeScope(jjtn000);
3215 + if (jjte000 instanceof RuntimeException) {
3216 + {if (true) throw (RuntimeException)jjte000;}
3218 + if (jjte000 instanceof ParseException) {
3219 + {if (true) throw (ParseException)jjte000;}
3221 + {if (true) throw (Error)jjte000;}
3224 + jjtree.closeNodeScope(jjtn000, true);
3227 + throw new Error("Missing return statement in function");
3230 + final public EvalItem FlattenedGenerateItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3231 + /*@bgen(jjtree) FlattenedGenerateItem */
3232 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEM);
3233 + boolean jjtc000 = true;
3234 + jjtree.openNodeScope(jjtn000);EvalItem item; SchemaItem schema = null;
3236 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3238 + jj_consume_token(FLATTEN);
3239 + jj_consume_token(54);
3240 + item = GenerateItem(over,pipes);
3241 + jj_consume_token(55);
3242 + if (!(item instanceof NestableEvalItem) ||
3243 + (item instanceof AtomFuncEvalItem) ){
3244 + {if (true) throw new ParseException("Cannot flatten atom field");}
3247 + EvalItemList list = new EvalItemList(pigContext);
3248 + list.add(new StarEvalItem(pigContext));
3249 + ((NestableEvalItem)item).subColSpec = list;
3254 + case QUOTEDSTRING:
3257 + item = GenerateItem(over,pipes);
3260 + jj_la1[30] = jj_gen;
3261 + jj_consume_token(-1);
3262 + throw new ParseException();
3264 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3266 + jj_consume_token(AS);
3267 + schema = SchemaElement();
3270 + jj_la1[31] = jj_gen;
3273 + jjtree.closeNodeScope(jjtn000, true);
3275 + item.schema = schema;
3276 + {if (true) return item;}
3277 + } catch (Throwable jjte000) {
3279 + jjtree.clearNodeScope(jjtn000);
3284 + if (jjte000 instanceof RuntimeException) {
3285 + {if (true) throw (RuntimeException)jjte000;}
3287 + if (jjte000 instanceof ParseException) {
3288 + {if (true) throw (ParseException)jjte000;}
3290 + {if (true) throw (Error)jjte000;}
3293 + jjtree.closeNodeScope(jjtn000, true);
3296 + throw new Error("Missing return statement in function");
3299 + final public EvalItem GenerateItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3300 + /*@bgen(jjtree) GenerateItem */
3301 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATEITEM);
3302 + boolean jjtc000 = true;
3303 + jjtree.openNodeScope(jjtn000);EvalItem item;
3305 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3308 + case QUOTEDSTRING:
3311 + item = InfixExpr(over,pipes);
3317 + jj_la1[32] = jj_gen;
3318 + jj_consume_token(-1);
3319 + throw new ParseException();
3321 + jjtree.closeNodeScope(jjtn000, true);
3323 + {if (true) return item;}
3324 + } catch (Throwable jjte000) {
3326 + jjtree.clearNodeScope(jjtn000);
3331 + if (jjte000 instanceof RuntimeException) {
3332 + {if (true) throw (RuntimeException)jjte000;}
3334 + if (jjte000 instanceof ParseException) {
3335 + {if (true) throw (ParseException)jjte000;}
3337 + {if (true) throw (Error)jjte000;}
3340 + jjtree.closeNodeScope(jjtn000, true);
3343 + throw new Error("Missing return statement in function");
3346 + final public EvalItem InfixExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3347 + /*@bgen(jjtree) InfixExpr */
3348 + SimpleNode jjtn000 = new SimpleNode(JJTINFIXEXPR);
3349 + boolean jjtc000 = true;
3350 + jjtree.openNodeScope(jjtn000);EvalItem expr;
3352 + expr = AdditiveExpr(over,pipes);
3353 + jjtree.closeNodeScope(jjtn000, true);
3355 + {if (true) return expr;}
3356 + } catch (Throwable jjte000) {
3358 + jjtree.clearNodeScope(jjtn000);
3363 + if (jjte000 instanceof RuntimeException) {
3364 + {if (true) throw (RuntimeException)jjte000;}
3366 + if (jjte000 instanceof ParseException) {
3367 + {if (true) throw (ParseException)jjte000;}
3369 + {if (true) throw (Error)jjte000;}
3372 + jjtree.closeNodeScope(jjtn000, true);
3375 + throw new Error("Missing return statement in function");
3378 + final public EvalItem AdditiveExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3379 + /*@bgen(jjtree) AdditiveExpr */
3380 + SimpleNode jjtn000 = new SimpleNode(JJTADDITIVEEXPR);
3381 + boolean jjtc000 = true;
3382 + jjtree.openNodeScope(jjtn000);Token t; EvalItem lhs, rhs; EvalItemList args;
3384 + lhs = MultiplicativeExpr(over,pipes);
3387 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3393 + jj_la1[33] = jj_gen;
3396 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3398 + t = jj_consume_token(59);
3401 + t = jj_consume_token(60);
3404 + jj_la1[34] = jj_gen;
3405 + jj_consume_token(-1);
3406 + throw new ParseException();
3408 + rhs = MultiplicativeExpr(over,pipes);
3409 + assertAtomic(lhs,true);
3410 + assertAtomic(rhs,true);
3411 + args = new EvalItemList(pigContext);
3414 + if (t.image.equals("+")){
3415 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("ADD"), args);
3417 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("SUBTRACT"), args);
3420 + jjtree.closeNodeScope(jjtn000, true);
3422 + {if (true) return lhs;}
3423 + } catch (Throwable jjte000) {
3425 + jjtree.clearNodeScope(jjtn000);
3430 + if (jjte000 instanceof RuntimeException) {
3431 + {if (true) throw (RuntimeException)jjte000;}
3433 + if (jjte000 instanceof ParseException) {
3434 + {if (true) throw (ParseException)jjte000;}
3436 + {if (true) throw (Error)jjte000;}
3439 + jjtree.closeNodeScope(jjtn000, true);
3442 + throw new Error("Missing return statement in function");
3445 + final public EvalItem MultiplicativeExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3446 + /*@bgen(jjtree) MultiplicativeExpr */
3447 + SimpleNode jjtn000 = new SimpleNode(JJTMULTIPLICATIVEEXPR);
3448 + boolean jjtc000 = true;
3449 + jjtree.openNodeScope(jjtn000);Token t; EvalItem lhs, rhs; EvalItemList args;
3451 + lhs = UnaryExpr(over,pipes);
3454 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3460 + jj_la1[35] = jj_gen;
3463 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3465 + t = jj_consume_token(STAR);
3468 + t = jj_consume_token(61);
3471 + jj_la1[36] = jj_gen;
3472 + jj_consume_token(-1);
3473 + throw new ParseException();
3475 + rhs = UnaryExpr(over,pipes);
3476 + assertAtomic(lhs,true);
3477 + assertAtomic(rhs,true);
3478 + args = new EvalItemList(pigContext);
3481 + if (t.image.equals("*")){
3482 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("MULTIPLY"), args);
3484 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("DIVIDE"), args);
3487 + jjtree.closeNodeScope(jjtn000, true);
3489 + {if (true) return lhs;}
3490 + } catch (Throwable jjte000) {
3492 + jjtree.clearNodeScope(jjtn000);
3497 + if (jjte000 instanceof RuntimeException) {
3498 + {if (true) throw (RuntimeException)jjte000;}
3500 + if (jjte000 instanceof ParseException) {
3501 + {if (true) throw (ParseException)jjte000;}
3503 + {if (true) throw (Error)jjte000;}
3506 + jjtree.closeNodeScope(jjtn000, true);
3509 + throw new Error("Missing return statement in function");
3512 + final public EvalItem UnaryExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3513 + /*@bgen(jjtree) UnaryExpr */
3514 + SimpleNode jjtn000 = new SimpleNode(JJTUNARYEXPR);
3515 + boolean jjtc000 = true;
3516 + jjtree.openNodeScope(jjtn000);EvalItem expr;
3518 + if (jj_2_8(2147483647)) {
3519 + expr = BaseEvalItem(over,pipes);
3521 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3523 + jj_consume_token(54);
3524 + expr = InfixExpr(over,pipes);
3525 + jj_consume_token(55);
3528 + jj_la1[37] = jj_gen;
3529 + jj_consume_token(-1);
3530 + throw new ParseException();
3533 + jjtree.closeNodeScope(jjtn000, true);
3535 + {if (true) return expr;}
3536 + } catch (Throwable jjte000) {
3538 + jjtree.clearNodeScope(jjtn000);
3543 + if (jjte000 instanceof RuntimeException) {
3544 + {if (true) throw (RuntimeException)jjte000;}
3546 + if (jjte000 instanceof ParseException) {
3547 + {if (true) throw (ParseException)jjte000;}
3549 + {if (true) throw (Error)jjte000;}
3552 + jjtree.closeNodeScope(jjtn000, true);
3555 + throw new Error("Missing return statement in function");
3558 + final public EvalItem BaseEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3559 + /*@bgen(jjtree) BaseEvalItem */
3560 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEVALITEM);
3561 + boolean jjtc000 = true;
3562 + jjtree.openNodeScope(jjtn000);EvalItem item;EvalItemList projection; SchemaItem subSchema = null;
3564 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3565 + case QUOTEDSTRING:
3572 + if (jj_2_9(2147483647)) {
3573 + item = FuncEvalItem(over,pipes);
3575 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3579 + item = PColEvalItem(over,pipes);
3582 + item = BinCond(over,pipes);
3585 + jj_la1[38] = jj_gen;
3586 + jj_consume_token(-1);
3587 + throw new ParseException();
3590 + subSchema = item.mapInputSchema(over);
3591 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3593 + jj_consume_token(62);
3594 + projection = BracketedSimpleProj(subSchema);
3595 + assertAtomic(item,false);
3596 + ((NestableEvalItem)item).addNestedEvalSpec(projection);
3599 + jj_la1[39] = jj_gen;
3604 + jj_la1[40] = jj_gen;
3605 + jj_consume_token(-1);
3606 + throw new ParseException();
3608 + jjtree.closeNodeScope(jjtn000, true);
3610 + {if (true) return item;}
3611 + } catch (Throwable jjte000) {
3613 + jjtree.clearNodeScope(jjtn000);
3618 + if (jjte000 instanceof RuntimeException) {
3619 + {if (true) throw (RuntimeException)jjte000;}
3621 + if (jjte000 instanceof ParseException) {
3622 + {if (true) throw (ParseException)jjte000;}
3624 + {if (true) throw (Error)jjte000;}
3627 + jjtree.closeNodeScope(jjtn000, true);
3630 + throw new Error("Missing return statement in function");
3633 + final public NestableEvalItem BinCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3634 + /*@bgen(jjtree) BinCond */
3635 + SimpleNode jjtn000 = new SimpleNode(JJTBINCOND);
3636 + boolean jjtc000 = true;
3637 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;
3639 + jj_consume_token(54);
3640 + cond = PCond(over,pipes);
3641 + jj_consume_token(63);
3642 + ifTrue = BaseEvalItem(over,pipes);
3643 + jj_consume_token(64);
3644 + ifFalse = BaseEvalItem(over,pipes);
3645 + jj_consume_token(55);
3646 + jjtree.closeNodeScope(jjtn000, true);
3648 + {if (true) return new BinCond(pigContext, cond,ifTrue,ifFalse);}
3649 + } catch (Throwable jjte000) {
3651 + jjtree.clearNodeScope(jjtn000);
3656 + if (jjte000 instanceof RuntimeException) {
3657 + {if (true) throw (RuntimeException)jjte000;}
3659 + if (jjte000 instanceof ParseException) {
3660 + {if (true) throw (ParseException)jjte000;}
3662 + {if (true) throw (Error)jjte000;}
3665 + jjtree.closeNodeScope(jjtn000, true);
3668 + throw new Error("Missing return statement in function");
3671 + final public NestableEvalItem FuncEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3672 + /*@bgen(jjtree) FuncEvalItem */
3673 + SimpleNode jjtn000 = new SimpleNode(JJTFUNCEVALITEM);
3674 + boolean jjtc000 = true;
3675 + jjtree.openNodeScope(jjtn000);EvalFunc func; EvalItemList args; NestableEvalItem i;
3677 + func = EvalFunction();
3678 + jj_consume_token(54);
3679 + args = EvalArgs(over,pipes);
3680 + jj_consume_token(55);
3681 + i = newFuncEvalItem(func, args);
3682 + jjtree.closeNodeScope(jjtn000, true);
3684 + {if (true) return i;}
3685 + } catch (Throwable jjte000) {
3687 + jjtree.clearNodeScope(jjtn000);
3692 + if (jjte000 instanceof RuntimeException) {
3693 + {if (true) throw (RuntimeException)jjte000;}
3695 + if (jjte000 instanceof ParseException) {
3696 + {if (true) throw (ParseException)jjte000;}
3698 + {if (true) throw (Error)jjte000;}
3701 + jjtree.closeNodeScope(jjtn000, true);
3704 + throw new Error("Missing return statement in function");
3707 + final public EvalItemList EvalArgs(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3708 + /*@bgen(jjtree) EvalArgs */
3709 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGS);
3710 + boolean jjtc000 = true;
3711 + jjtree.openNodeScope(jjtn000);EvalItemList list = new EvalItemList(pigContext); EvalItem item;
3713 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3717 + case QUOTEDSTRING:
3720 + item = EvalArgsItem(over,pipes);
3724 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3729 + jj_la1[41] = jj_gen;
3732 + jj_consume_token(56);
3733 + item = EvalArgsItem(over,pipes);
3738 + jj_la1[42] = jj_gen;
3739 + list = new EvalItemList(pigContext);
3741 + jjtree.closeNodeScope(jjtn000, true);
3743 + if (!list.isSimple()){
3744 + {if (true) throw new ParseException("Cannot have non-jave function as an argument");}
3746 + {if (true) return list;}
3747 + } catch (Throwable jjte000) {
3749 + jjtree.clearNodeScope(jjtn000);
3754 + if (jjte000 instanceof RuntimeException) {
3755 + {if (true) throw (RuntimeException)jjte000;}
3757 + if (jjte000 instanceof ParseException) {
3758 + {if (true) throw (ParseException)jjte000;}
3760 + {if (true) throw (Error)jjte000;}
3763 + jjtree.closeNodeScope(jjtn000, true);
3766 + throw new Error("Missing return statement in function");
3769 + final public EvalItem EvalArgsItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3770 + /*@bgen(jjtree) EvalArgsItem */
3771 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGSITEM);
3772 + boolean jjtc000 = true;
3773 + jjtree.openNodeScope(jjtn000);EvalItem item;
3775 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3778 + case QUOTEDSTRING:
3781 + item = InfixExpr(over,pipes);
3787 + jj_la1[43] = jj_gen;
3788 + jj_consume_token(-1);
3789 + throw new ParseException();
3791 + jjtree.closeNodeScope(jjtn000, true);
3793 + {if (true) return item;}
3794 + } catch (Throwable jjte000) {
3796 + jjtree.clearNodeScope(jjtn000);
3801 + if (jjte000 instanceof RuntimeException) {
3802 + {if (true) throw (RuntimeException)jjte000;}
3804 + if (jjte000 instanceof ParseException) {
3805 + {if (true) throw (ParseException)jjte000;}
3807 + {if (true) throw (Error)jjte000;}
3810 + jjtree.closeNodeScope(jjtn000, true);
3813 + throw new Error("Missing return statement in function");
3816 +// Map a user schema onto a LogicalOperator
3817 + final public SchemaItemList AsClause() throws ParseException {
3818 + /*@bgen(jjtree) AsClause */
3819 + SimpleNode jjtn000 = new SimpleNode(JJTASCLAUSE);
3820 + boolean jjtc000 = true;
3821 + jjtree.openNodeScope(jjtn000);Token t1; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); Token t = null;
3823 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3826 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3828 + t = jj_consume_token(IDENTIFIER);
3831 + t = jj_consume_token(GROUP);
3834 + jj_la1[44] = jj_gen;
3835 + jj_consume_token(-1);
3836 + throw new ParseException();
3838 + jj_consume_token(64);
3841 + jj_la1[45] = jj_gen;
3844 + jj_consume_token(54);
3845 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3850 + item = SchemaElement();
3854 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3859 + jj_la1[46] = jj_gen;
3862 + jj_consume_token(56);
3863 + item = SchemaElement();
3868 + jj_la1[47] = jj_gen;
3869 + list = new SchemaItemList();
3871 + jj_consume_token(55);
3872 + jjtree.closeNodeScope(jjtn000, true);
3875 + list.alias = t.image;
3876 + {if (true) return list;}
3877 + } catch (Throwable jjte000) {
3879 + jjtree.clearNodeScope(jjtn000);
3884 + if (jjte000 instanceof RuntimeException) {
3885 + {if (true) throw (RuntimeException)jjte000;}
3887 + if (jjte000 instanceof ParseException) {
3888 + {if (true) throw (ParseException)jjte000;}
3890 + {if (true) throw (Error)jjte000;}
3893 + jjtree.closeNodeScope(jjtn000, true);
3896 + throw new Error("Missing return statement in function");
3899 + final public SchemaItem SchemaElement() throws ParseException {
3900 + /*@bgen(jjtree) SchemaElement */
3901 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAELEMENT);
3902 + boolean jjtc000 = true;
3903 + jjtree.openNodeScope(jjtn000);Token t1; SchemaItem item = null;
3905 + if (jj_2_10(2147483647)) {
3906 + item = SchemaBag();
3907 + } else if (jj_2_11(2147483647)) {
3908 + item = SchemaTuple();
3909 + } else if (jj_2_12(2147483647)) {
3910 + item = SchemaField();
3912 + jj_consume_token(-1);
3913 + throw new ParseException();
3915 + jjtree.closeNodeScope(jjtn000, true);
3917 + {if (true) return item;}
3918 + } catch (Throwable jjte000) {
3920 + jjtree.clearNodeScope(jjtn000);
3925 + if (jjte000 instanceof RuntimeException) {
3926 + {if (true) throw (RuntimeException)jjte000;}
3928 + if (jjte000 instanceof ParseException) {
3929 + {if (true) throw (ParseException)jjte000;}
3931 + {if (true) throw (Error)jjte000;}
3934 + jjtree.closeNodeScope(jjtn000, true);
3937 + throw new Error("Missing return statement in function");
3940 + final public SchemaItem SchemaField() throws ParseException {
3941 + /*@bgen(jjtree) SchemaField */
3942 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAFIELD);
3943 + boolean jjtc000 = true;
3944 + jjtree.openNodeScope(jjtn000);Token t1;
3946 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3948 + t1 = jj_consume_token(IDENTIFIER);
3951 + t1 = jj_consume_token(GROUP);
3954 + jj_la1[48] = jj_gen;
3955 + jj_consume_token(-1);
3956 + throw new ParseException();
3958 + jjtree.closeNodeScope(jjtn000, true);
3960 + {if (true) return new SchemaField(t1.image);}
3963 + jjtree.closeNodeScope(jjtn000, true);
3966 + throw new Error("Missing return statement in function");
3969 + final public SchemaItem SchemaTuple() throws ParseException {
3970 + /*@bgen(jjtree) SchemaTuple */
3971 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMATUPLE);
3972 + boolean jjtc000 = true;
3973 + jjtree.openNodeScope(jjtn000);Token t1 = null; SchemaItem item = null; SchemaItemList list = new SchemaItemList();
3975 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3978 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3980 + t1 = jj_consume_token(IDENTIFIER);
3983 + t1 = jj_consume_token(GROUP);
3986 + jj_la1[49] = jj_gen;
3987 + jj_consume_token(-1);
3988 + throw new ParseException();
3990 + jj_consume_token(64);
3993 + jj_la1[50] = jj_gen;
3996 + jj_consume_token(54);
3997 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4002 + item = SchemaElement();
4006 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4011 + jj_la1[51] = jj_gen;
4014 + jj_consume_token(56);
4015 + item = SchemaElement();
4020 + jj_la1[52] = jj_gen;
4023 + jj_consume_token(55);
4024 + jjtree.closeNodeScope(jjtn000, true);
4027 + list.alias = t1.image;
4028 + list.setIsBag(false);
4029 + {if (true) return list;}
4030 + } catch (Throwable jjte000) {
4032 + jjtree.clearNodeScope(jjtn000);
4037 + if (jjte000 instanceof RuntimeException) {
4038 + {if (true) throw (RuntimeException)jjte000;}
4040 + if (jjte000 instanceof ParseException) {
4041 + {if (true) throw (ParseException)jjte000;}
4043 + {if (true) throw (Error)jjte000;}
4046 + jjtree.closeNodeScope(jjtn000, true);
4049 + throw new Error("Missing return statement in function");
4052 + final public SchemaItem SchemaBag() throws ParseException {
4053 + /*@bgen(jjtree) SchemaBag */
4054 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMABAG);
4055 + boolean jjtc000 = true;
4056 + jjtree.openNodeScope(jjtn000);Token t1=null; SchemaItem item = null; SchemaItemList list = new SchemaItemList();
4058 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4060 + t1 = jj_consume_token(IDENTIFIER);
4061 + jj_consume_token(64);
4064 + jj_la1[53] = jj_gen;
4067 + jj_consume_token(65);
4068 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4073 + item = SchemaElement();
4077 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4082 + jj_la1[54] = jj_gen;
4085 + jj_consume_token(56);
4086 + item = SchemaElement();
4091 + jj_la1[55] = jj_gen;
4094 + jj_consume_token(66);
4095 + jjtree.closeNodeScope(jjtn000, true);
4098 + list.alias = t1.image;
4099 + list.setIsBag(true);
4100 + {if (true) return list;}
4101 + } catch (Throwable jjte000) {
4103 + jjtree.clearNodeScope(jjtn000);
4108 + if (jjte000 instanceof RuntimeException) {
4109 + {if (true) throw (RuntimeException)jjte000;}
4111 + if (jjte000 instanceof ParseException) {
4112 + {if (true) throw (ParseException)jjte000;}
4114 + {if (true) throw (Error)jjte000;}
4117 + jjtree.closeNodeScope(jjtn000, true);
4120 + throw new Error("Missing return statement in function");
4123 +// Used in serialization and deserialization
4124 + final public EvalSpecPipe PEvalSpecPipe() throws ParseException {
4125 + /*@bgen(jjtree) PEvalSpecPipe */
4126 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPECPIPE);
4127 + boolean jjtc000 = true;
4128 + jjtree.openNodeScope(jjtn000);EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalSpec spec;
4132 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4137 + jj_la1[56] = jj_gen;
4140 + jj_consume_token(65);
4141 + spec = PEvalSpec();
4142 + jj_consume_token(66);
4145 + jjtree.closeNodeScope(jjtn000, true);
4147 + {if (true) return pipe;}
4148 + } catch (Throwable jjte000) {
4150 + jjtree.clearNodeScope(jjtn000);
4155 + if (jjte000 instanceof RuntimeException) {
4156 + {if (true) throw (RuntimeException)jjte000;}
4158 + if (jjte000 instanceof ParseException) {
4159 + {if (true) throw (ParseException)jjte000;}
4161 + {if (true) throw (Error)jjte000;}
4164 + jjtree.closeNodeScope(jjtn000, true);
4167 + throw new Error("Missing return statement in function");
4170 + final public EvalSpec PEvalSpec() throws ParseException {
4171 + /*@bgen(jjtree) PEvalSpec */
4172 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPEC);
4173 + boolean jjtc000 = true;
4174 + jjtree.openNodeScope(jjtn000);EvalSpec spec;
4176 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4178 + jj_consume_token(FILTER);
4182 + jj_consume_token(EVAL);
4183 + spec = PEvalItemList();
4191 + jj_la1[57] = jj_gen;
4192 + jj_consume_token(-1);
4193 + throw new ParseException();
4195 + jjtree.closeNodeScope(jjtn000, true);
4197 + {if (true) return spec;}
4198 + } catch (Throwable jjte000) {
4200 + jjtree.clearNodeScope(jjtn000);
4205 + if (jjte000 instanceof RuntimeException) {
4206 + {if (true) throw (RuntimeException)jjte000;}
4208 + if (jjte000 instanceof ParseException) {
4209 + {if (true) throw (ParseException)jjte000;}
4211 + {if (true) throw (Error)jjte000;}
4214 + jjtree.closeNodeScope(jjtn000, true);
4217 + throw new Error("Missing return statement in function");
4220 + final public EvalSpec PFilter() throws ParseException {
4221 + /*@bgen(jjtree) PFilter */
4222 + SimpleNode jjtn000 = new SimpleNode(JJTPFILTER);
4223 + boolean jjtc000 = true;
4224 + jjtree.openNodeScope(jjtn000);Cond cond;
4226 + cond = PCond(null,null);
4227 + jjtree.closeNodeScope(jjtn000, true);
4229 + {if (true) return new FilterSpec(cond);}
4230 + } catch (Throwable jjte000) {
4232 + jjtree.clearNodeScope(jjtn000);
4237 + if (jjte000 instanceof RuntimeException) {
4238 + {if (true) throw (RuntimeException)jjte000;}
4240 + if (jjte000 instanceof ParseException) {
4241 + {if (true) throw (ParseException)jjte000;}
4243 + {if (true) throw (Error)jjte000;}
4246 + jjtree.closeNodeScope(jjtn000, true);
4249 + throw new Error("Missing return statement in function");
4252 + final public EvalSpec PSAD() throws ParseException {
4253 + /*@bgen(jjtree) PSAD */
4254 + SimpleNode jjtn000 = new SimpleNode(JJTPSAD);
4255 + boolean jjtc000 = true;
4256 + jjtree.openNodeScope(jjtn000);EvalSpec sad; EvalItemList proj;
4258 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4260 + jj_consume_token(ORDER);
4261 + jj_consume_token(BY);
4262 + proj = SimpleProj(null);
4263 + sad = new SortArrangeSpec(proj, false);
4266 + jj_consume_token(ARRANGE);
4267 + jj_consume_token(BY);
4268 + proj = SimpleProj(null);
4269 + sad = new SortArrangeSpec(proj, true);
4272 + jj_consume_token(DISTINCT);
4273 + proj = SimpleProj(null);
4274 + sad = new DistinctSpec(proj);
4277 + jj_la1[58] = jj_gen;
4278 + jj_consume_token(-1);
4279 + throw new ParseException();
4281 + jjtree.closeNodeScope(jjtn000, true);
4283 + {if (true) return sad;}
4284 + } catch (Throwable jjte000) {
4286 + jjtree.clearNodeScope(jjtn000);
4291 + if (jjte000 instanceof RuntimeException) {
4292 + {if (true) throw (RuntimeException)jjte000;}
4294 + if (jjte000 instanceof ParseException) {
4295 + {if (true) throw (ParseException)jjte000;}
4297 + {if (true) throw (Error)jjte000;}
4300 + jjtree.closeNodeScope(jjtn000, true);
4303 + throw new Error("Missing return statement in function");
4306 + final public EvalItemList PEvalItemList() throws ParseException {
4307 + /*@bgen(jjtree) PEvalItemList */
4308 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEMLIST);
4309 + boolean jjtc000 = true;
4310 + jjtree.openNodeScope(jjtn000);EvalItemList list = new EvalItemList(pigContext); EvalItem item;
4312 + item = PEvalItem();
4316 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4321 + jj_la1[59] = jj_gen;
4324 + jj_consume_token(56);
4325 + item = PEvalItem();
4328 + jjtree.closeNodeScope(jjtn000, true);
4330 + {if (true) return list;}
4331 + } catch (Throwable jjte000) {
4333 + jjtree.clearNodeScope(jjtn000);
4338 + if (jjte000 instanceof RuntimeException) {
4339 + {if (true) throw (RuntimeException)jjte000;}
4341 + if (jjte000 instanceof ParseException) {
4342 + {if (true) throw (ParseException)jjte000;}
4344 + {if (true) throw (Error)jjte000;}
4347 + jjtree.closeNodeScope(jjtn000, true);
4350 + throw new Error("Missing return statement in function");
4353 + final public EvalItem PEvalItem() throws ParseException {
4354 + /*@bgen(jjtree) PEvalItem */
4355 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEM);
4356 + boolean jjtc000 = true;
4357 + jjtree.openNodeScope(jjtn000);EvalItem item; EvalSpec subSpec; EvalItemList subProj; LogicalOperator subOp = null;
4359 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4360 + case QUOTEDSTRING:
4369 + item = PNestableEvalItem();
4372 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4377 + jj_la1[60] = jj_gen;
4380 + jj_consume_token(65);
4381 + subSpec = PEvalSpec();
4382 + jj_consume_token(66);
4383 + ((NestableEvalItem) item).addNestedEvalSpec(subSpec);
4385 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4387 + jj_consume_token(62);
4388 + jj_consume_token(54);
4390 + jj_consume_token(55);
4391 + EvalItemList list = new EvalItemList(pigContext);
4392 + list.add(new StarEvalItem(pigContext));
4393 + ((NestableEvalItem) item).subColSpec = list;
4396 + jj_la1[61] = jj_gen;
4401 + jj_la1[62] = jj_gen;
4402 + jj_consume_token(-1);
4403 + throw new ParseException();
4405 + jjtree.closeNodeScope(jjtn000, true);
4407 + {if (true) return item;}
4408 + } catch (Throwable jjte000) {
4410 + jjtree.clearNodeScope(jjtn000);
4415 + if (jjte000 instanceof RuntimeException) {
4416 + {if (true) throw (RuntimeException)jjte000;}
4418 + if (jjte000 instanceof ParseException) {
4419 + {if (true) throw (ParseException)jjte000;}
4421 + {if (true) throw (Error)jjte000;}
4424 + jjtree.closeNodeScope(jjtn000, true);
4427 + throw new Error("Missing return statement in function");
4430 + final public NestableEvalItem PNestableEvalItem() throws ParseException {
4431 + /*@bgen(jjtree) PNestableEvalItem */
4432 + SimpleNode jjtn000 = new SimpleNode(JJTPNESTABLEEVALITEM);
4433 + boolean jjtc000 = true;
4434 + jjtree.openNodeScope(jjtn000);NestableEvalItem item;
4436 + if (jj_2_13(2147483647)) {
4437 + item = EvalFunctionItem();
4438 + } else if (jj_2_14(2147483647)) {
4439 + item = DollarVar();
4440 + } else if (jj_2_15(2147483647)) {
4441 + item = SerializedBinCond();
4443 + jj_consume_token(-1);
4444 + throw new ParseException();
4446 + jjtree.closeNodeScope(jjtn000, true);
4448 + {if (true) return item;}
4449 + } catch (Throwable jjte000) {
4451 + jjtree.clearNodeScope(jjtn000);
4456 + if (jjte000 instanceof RuntimeException) {
4457 + {if (true) throw (RuntimeException)jjte000;}
4459 + if (jjte000 instanceof ParseException) {
4460 + {if (true) throw (ParseException)jjte000;}
4462 + {if (true) throw (Error)jjte000;}
4465 + jjtree.closeNodeScope(jjtn000, true);
4468 + throw new Error("Missing return statement in function");
4471 + final public NestableEvalItem EvalFunctionItem() throws ParseException {
4472 + /*@bgen(jjtree) EvalFunctionItem */
4473 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTIONITEM);
4474 + boolean jjtc000 = true;
4475 + jjtree.openNodeScope(jjtn000);EvalFunc func; EvalItemList args; NestableEvalItem i;
4477 + func = EvalFunction();
4478 + jj_consume_token(54);
4479 + args = PEvalItemList();
4480 + jj_consume_token(55);
4481 + i = newFuncEvalItem(func, args);
4482 + jjtree.closeNodeScope(jjtn000, true);
4484 + {if (true) return i;}
4485 + } catch (Throwable jjte000) {
4487 + jjtree.clearNodeScope(jjtn000);
4492 + if (jjte000 instanceof RuntimeException) {
4493 + {if (true) throw (RuntimeException)jjte000;}
4495 + if (jjte000 instanceof ParseException) {
4496 + {if (true) throw (ParseException)jjte000;}
4498 + {if (true) throw (Error)jjte000;}
4501 + jjtree.closeNodeScope(jjtn000, true);
4504 + throw new Error("Missing return statement in function");
4507 + final public NestableEvalItem SerializedBinCond() throws ParseException {
4508 + /*@bgen(jjtree) SerializedBinCond */
4509 + SimpleNode jjtn000 = new SimpleNode(JJTSERIALIZEDBINCOND);
4510 + boolean jjtc000 = true;
4511 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;
4513 + jj_consume_token(54);
4514 + cond = PSerializedCond();
4515 + jj_consume_token(63);
4516 + ifTrue = PEvalItem();
4517 + jj_consume_token(64);
4518 + ifFalse = PEvalItem();
4519 + jj_consume_token(55);
4520 + jjtree.closeNodeScope(jjtn000, true);
4522 + {if (true) return new BinCond(pigContext, cond,ifTrue,ifFalse);}
4523 + } catch (Throwable jjte000) {
4525 + jjtree.clearNodeScope(jjtn000);
4530 + if (jjte000 instanceof RuntimeException) {
4531 + {if (true) throw (RuntimeException)jjte000;}
4533 + if (jjte000 instanceof ParseException) {
4534 + {if (true) throw (ParseException)jjte000;}
4536 + {if (true) throw (Error)jjte000;}
4539 + jjtree.closeNodeScope(jjtn000, true);
4542 + throw new Error("Missing return statement in function");
4545 + final public Cond PSerializedCond() throws ParseException {
4546 + /*@bgen(jjtree) PSerializedCond */
4547 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDCOND);
4548 + boolean jjtc000 = true;
4549 + jjtree.openNodeScope(jjtn000);Cond cond = null;
4551 + cond = PSerializedOrCond();
4552 + jjtree.closeNodeScope(jjtn000, true);
4554 + {if (true) return cond;}
4555 + } catch (Throwable jjte000) {
4557 + jjtree.clearNodeScope(jjtn000);
4562 + if (jjte000 instanceof RuntimeException) {
4563 + {if (true) throw (RuntimeException)jjte000;}
4565 + if (jjte000 instanceof ParseException) {
4566 + {if (true) throw (ParseException)jjte000;}
4568 + {if (true) throw (Error)jjte000;}
4571 + jjtree.closeNodeScope(jjtn000, true);
4574 + throw new Error("Missing return statement in function");
4577 + final public Cond PSerializedOrCond() throws ParseException {
4578 + /*@bgen(jjtree) PSerializedOrCond */
4579 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDORCOND);
4580 + boolean jjtc000 = true;
4581 + jjtree.openNodeScope(jjtn000);Cond cond; List<Cond> cList = new ArrayList<Cond>();
4583 + cond = PSerializedAndCond();
4587 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4592 + jj_la1[63] = jj_gen;
4595 + jj_consume_token(OR);
4596 + cond = PSerializedAndCond();
4599 + jjtree.closeNodeScope(jjtn000, true);
4601 + if (cList.size()==1)
4602 + {if (true) return cond;}
4604 + {if (true) return new OrCond(cList);}
4605 + } catch (Throwable jjte000) {
4607 + jjtree.clearNodeScope(jjtn000);
4612 + if (jjte000 instanceof RuntimeException) {
4613 + {if (true) throw (RuntimeException)jjte000;}
4615 + if (jjte000 instanceof ParseException) {
4616 + {if (true) throw (ParseException)jjte000;}
4618 + {if (true) throw (Error)jjte000;}
4621 + jjtree.closeNodeScope(jjtn000, true);
4624 + throw new Error("Missing return statement in function");
4627 + final public Cond PSerializedAndCond() throws ParseException {
4628 + /*@bgen(jjtree) PSerializedAndCond */
4629 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDANDCOND);
4630 + boolean jjtc000 = true;
4631 + jjtree.openNodeScope(jjtn000);Cond cond = null; List<Cond> cList = new ArrayList<Cond>();
4633 + cond = PSerializedUnaryCond();
4637 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4642 + jj_la1[64] = jj_gen;
4645 + jj_consume_token(AND);
4646 + cond = PSerializedUnaryCond();
4649 + jjtree.closeNodeScope(jjtn000, true);
4651 + if (cList.size()==1)
4652 + {if (true) return cond;}
4654 + {if (true) return new AndCond(cList);}
4655 + } catch (Throwable jjte000) {
4657 + jjtree.clearNodeScope(jjtn000);
4662 + if (jjte000 instanceof RuntimeException) {
4663 + {if (true) throw (RuntimeException)jjte000;}
4665 + if (jjte000 instanceof ParseException) {
4666 + {if (true) throw (ParseException)jjte000;}
4668 + {if (true) throw (Error)jjte000;}
4671 + jjtree.closeNodeScope(jjtn000, true);
4674 + throw new Error("Missing return statement in function");
4677 + final public Cond PSerializedUnaryCond() throws ParseException {
4678 + /*@bgen(jjtree) PSerializedUnaryCond */
4679 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDUNARYCOND);
4680 + boolean jjtc000 = true;
4681 + jjtree.openNodeScope(jjtn000);Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;
4683 + if (jj_2_16(2147483647)) {
4684 + jj_consume_token(54);
4685 + cond = PSerializedCond();
4686 + jj_consume_token(55);
4688 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4690 + cond = PSerializedNotCond();
4693 + jj_la1[65] = jj_gen;
4694 + if (jj_2_17(2147483647)) {
4696 + t1 = jj_consume_token(FILTEROP);
4698 + cond = new CompCond(c1, t1.image, c2);
4699 + } else if (jj_2_18(2147483647)) {
4701 + jj_consume_token(MATCHES);
4702 + t1 = jj_consume_token(QUOTEDSTRING);
4703 + cond = new RegexpCond(c1, unquote(t1.image));
4705 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4707 + func = FilterFunction();
4708 + jj_consume_token(54);
4709 + args = PEvalItemList();
4710 + jj_consume_token(55);
4711 + cond = new FuncCond(func, args);
4714 + jj_la1[66] = jj_gen;
4715 + jj_consume_token(-1);
4716 + throw new ParseException();
4721 + jjtree.closeNodeScope(jjtn000, true);
4723 + {if (true) return cond;}
4724 + } catch (Throwable jjte000) {
4726 + jjtree.clearNodeScope(jjtn000);
4731 + if (jjte000 instanceof RuntimeException) {
4732 + {if (true) throw (RuntimeException)jjte000;}
4734 + if (jjte000 instanceof ParseException) {
4735 + {if (true) throw (ParseException)jjte000;}
4737 + {if (true) throw (Error)jjte000;}
4740 + jjtree.closeNodeScope(jjtn000, true);
4743 + throw new Error("Missing return statement in function");
4746 + final public Cond PSerializedNotCond() throws ParseException {
4747 + /*@bgen(jjtree) PSerializedNotCond */
4748 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDNOTCOND);
4749 + boolean jjtc000 = true;
4750 + jjtree.openNodeScope(jjtn000);Cond c1;
4752 + jj_consume_token(NOT);
4753 + c1 = PSerializedUnaryCond();
4754 + jjtree.closeNodeScope(jjtn000, true);
4756 + {if (true) return new NotCond(c1);}
4757 + } catch (Throwable jjte000) {
4759 + jjtree.clearNodeScope(jjtn000);
4764 + if (jjte000 instanceof RuntimeException) {
4765 + {if (true) throw (RuntimeException)jjte000;}
4767 + if (jjte000 instanceof ParseException) {
4768 + {if (true) throw (ParseException)jjte000;}
4770 + {if (true) throw (Error)jjte000;}
4773 + jjtree.closeNodeScope(jjtn000, true);
4776 + throw new Error("Missing return statement in function");
4780 + final public EvalSpec PWindow() throws ParseException {
4781 + /*@bgen(jjtree) PWindow */
4782 + SimpleNode jjtn000 = new SimpleNode(JJTPWINDOW);
4783 + boolean jjtc000 = true;
4784 + jjtree.openNodeScope(jjtn000);EvalSpec spec; int numTuples; double time;
4786 + jj_consume_token(WINDOW);
4788 + time = PTimeWindow();
4789 + spec = new TimeWindowSpec(WindowSpec.windowType.SLIDING, time);
4791 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4793 + numTuples = PTupleWindow();
4794 + spec = new TupleWindowSpec(WindowSpec.windowType.SLIDING, numTuples);
4797 + jj_la1[67] = jj_gen;
4798 + jj_consume_token(-1);
4799 + throw new ParseException();
4802 + jjtree.closeNodeScope(jjtn000, true);
4804 + {if (true) return spec;}
4805 + } catch (Throwable jjte000) {
4807 + jjtree.clearNodeScope(jjtn000);
4812 + if (jjte000 instanceof RuntimeException) {
4813 + {if (true) throw (RuntimeException)jjte000;}
4815 + if (jjte000 instanceof ParseException) {
4816 + {if (true) throw (ParseException)jjte000;}
4818 + {if (true) throw (Error)jjte000;}
4821 + jjtree.closeNodeScope(jjtn000, true);
4824 + throw new Error("Missing return statement in function");
4827 + final public double PTimeWindow() throws ParseException {
4828 + /*@bgen(jjtree) PTimeWindow */
4829 + SimpleNode jjtn000 = new SimpleNode(JJTPTIMEWINDOW);
4830 + boolean jjtc000 = true;
4831 + jjtree.openNodeScope(jjtn000);double n; Token t;
4833 + t = jj_consume_token(NUMBER);
4834 + n = Double.parseDouble(t.image);
4835 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4837 + jj_consume_token(SECONDS);
4840 + jj_consume_token(MINUTES);
4844 + jj_consume_token(HOURS);
4848 + jj_la1[68] = jj_gen;
4849 + jj_consume_token(-1);
4850 + throw new ParseException();
4852 + jjtree.closeNodeScope(jjtn000, true);
4854 + {if (true) return n;}
4857 + jjtree.closeNodeScope(jjtn000, true);
4860 + throw new Error("Missing return statement in function");
4863 + final public int PTupleWindow() throws ParseException {
4864 + /*@bgen(jjtree) PTupleWindow */
4865 + SimpleNode jjtn000 = new SimpleNode(JJTPTUPLEWINDOW);
4866 + boolean jjtc000 = true;
4867 + jjtree.openNodeScope(jjtn000);int n; Token t;
4869 + t = jj_consume_token(NUMBER);
4871 + n = Integer.parseInt(t.image);
4872 + }catch(NumberFormatException e){
4873 + {if (true) throw new ParseException("Only whole number tuple windows allowed.");}
4875 + jj_consume_token(TUPLES);
4876 + jjtree.closeNodeScope(jjtn000, true);
4878 + {if (true) return n;}
4881 + jjtree.closeNodeScope(jjtn000, true);
4884 + throw new Error("Missing return statement in function");
4887 +// These the simple non-terminals that are shared across many
4888 + final public EvalFunc EvalFunction() throws ParseException {
4889 + /*@bgen(jjtree) EvalFunction */
4890 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTION);
4891 + boolean jjtc000 = true;
4892 + jjtree.openNodeScope(jjtn000);String funcName;
4894 + funcName = QualifiedFunction();
4895 + jjtree.closeNodeScope(jjtn000, true);
4897 + {if (true) return (EvalFunc) pigContext.getUDF(funcName);}
4898 + } catch (Throwable jjte000) {
4900 + jjtree.clearNodeScope(jjtn000);
4905 + if (jjte000 instanceof RuntimeException) {
4906 + {if (true) throw (RuntimeException)jjte000;}
4908 + if (jjte000 instanceof ParseException) {
4909 + {if (true) throw (ParseException)jjte000;}
4911 + {if (true) throw (Error)jjte000;}
4914 + jjtree.closeNodeScope(jjtn000, true);
4917 + throw new Error("Missing return statement in function");
4920 + final public GroupFunc GroupFunction() throws ParseException {
4921 + /*@bgen(jjtree) GroupFunction */
4922 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPFUNCTION);
4923 + boolean jjtc000 = true;
4924 + jjtree.openNodeScope(jjtn000);String funcName;
4926 + funcName = QualifiedFunction();
4927 + jjtree.closeNodeScope(jjtn000, true);
4929 + {if (true) return (GroupFunc) pigContext.getUDF(funcName);}
4930 + } catch (Throwable jjte000) {
4932 + jjtree.clearNodeScope(jjtn000);
4937 + if (jjte000 instanceof RuntimeException) {
4938 + {if (true) throw (RuntimeException)jjte000;}
4940 + if (jjte000 instanceof ParseException) {
4941 + {if (true) throw (ParseException)jjte000;}
4943 + {if (true) throw (Error)jjte000;}
4946 + jjtree.closeNodeScope(jjtn000, true);
4949 + throw new Error("Missing return statement in function");
4952 + final public StorageFunc LoadFunction() throws ParseException {
4953 + /*@bgen(jjtree) LoadFunction */
4954 + SimpleNode jjtn000 = new SimpleNode(JJTLOADFUNCTION);
4955 + boolean jjtc000 = true;
4956 + jjtree.openNodeScope(jjtn000);String funcName;
4958 + funcName = QualifiedFunction();
4959 + jjtree.closeNodeScope(jjtn000, true);
4961 + {if (true) return (StorageFunc) pigContext.getUDF(funcName);}
4962 + } catch (Throwable jjte000) {
4964 + jjtree.clearNodeScope(jjtn000);
4969 + if (jjte000 instanceof RuntimeException) {
4970 + {if (true) throw (RuntimeException)jjte000;}
4972 + if (jjte000 instanceof ParseException) {
4973 + {if (true) throw (ParseException)jjte000;}
4975 + {if (true) throw (Error)jjte000;}
4978 + jjtree.closeNodeScope(jjtn000, true);
4981 + throw new Error("Missing return statement in function");
4984 + final public FilterFunc FilterFunction() throws ParseException {
4985 + /*@bgen(jjtree) FilterFunction */
4986 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERFUNCTION);
4987 + boolean jjtc000 = true;
4988 + jjtree.openNodeScope(jjtn000);String funcName;
4990 + funcName = QualifiedFunction();
4991 + jjtree.closeNodeScope(jjtn000, true);
4993 + {if (true) return (FilterFunc) pigContext.getUDF(funcName);}
4994 + } catch (Throwable jjte000) {
4996 + jjtree.clearNodeScope(jjtn000);
5001 + if (jjte000 instanceof RuntimeException) {
5002 + {if (true) throw (RuntimeException)jjte000;}
5004 + if (jjte000 instanceof ParseException) {
5005 + {if (true) throw (ParseException)jjte000;}
5007 + {if (true) throw (Error)jjte000;}
5010 + jjtree.closeNodeScope(jjtn000, true);
5013 + throw new Error("Missing return statement in function");
5017 + * Bug 831620 - '$' support
5019 + final public void ClassName() throws ParseException {
5020 + jj_consume_token(IDENTIFIER);
5023 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5029 + jj_la1[69] = jj_gen;
5032 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5034 + jj_consume_token(62);
5035 + jj_consume_token(IDENTIFIER);
5038 + jj_consume_token(67);
5039 + jj_consume_token(IDENTIFIER);
5042 + jj_la1[70] = jj_gen;
5043 + jj_consume_token(-1);
5044 + throw new ParseException();
5050 + * Bug 831620 - '$' support
5052 + final public String QualifiedFunction() throws ParseException {
5053 + Token t1;StringBuffer s=new StringBuffer();
5054 + t1 = jj_consume_token(IDENTIFIER);
5055 + s.append(t1.image);
5058 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5064 + jj_la1[71] = jj_gen;
5067 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5069 + jj_consume_token(62);
5070 + t1 = jj_consume_token(IDENTIFIER);
5071 + s.append("." + t1.image);
5074 + jj_consume_token(67);
5075 + t1 = jj_consume_token(IDENTIFIER);
5076 + s.append("$" + t1.image);
5079 + jj_la1[72] = jj_gen;
5080 + jj_consume_token(-1);
5081 + throw new ParseException();
5084 + {if (true) return s.toString();}
5085 + throw new Error("Missing return statement in function");
5088 +// If there is one time it may not be bracketed, but if multiple, they must be bracketed
5089 + final public EvalItemList BracketedSimpleProj(SchemaItem over) throws ParseException {
5090 + /*@bgen(jjtree) BracketedSimpleProj */
5091 + SimpleNode jjtn000 = new SimpleNode(JJTBRACKETEDSIMPLEPROJ);
5092 + boolean jjtc000 = true;
5093 + jjtree.openNodeScope(jjtn000);EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);
5095 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5099 + case QUOTEDSTRING:
5101 + i = PSimpleProjItem(over);
5105 + jj_consume_token(54);
5106 + i = PSimpleProjItem(over);
5110 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5115 + jj_la1[73] = jj_gen;
5118 + jj_consume_token(56);
5119 + i = PSimpleProjItem(over);
5122 + jj_consume_token(55);
5125 + jj_la1[74] = jj_gen;
5126 + jj_consume_token(-1);
5127 + throw new ParseException();
5129 + jjtree.closeNodeScope(jjtn000, true);
5131 + {if (true) return proj;}
5132 + } catch (Throwable jjte000) {
5134 + jjtree.clearNodeScope(jjtn000);
5139 + if (jjte000 instanceof RuntimeException) {
5140 + {if (true) throw (RuntimeException)jjte000;}
5142 + if (jjte000 instanceof ParseException) {
5143 + {if (true) throw (ParseException)jjte000;}
5145 + {if (true) throw (Error)jjte000;}
5148 + jjtree.closeNodeScope(jjtn000, true);
5151 + throw new Error("Missing return statement in function");
5154 + final public EvalItemList SimpleProjOrEmpty(SchemaItem over) throws ParseException {
5155 + /*@bgen(jjtree) SimpleProjOrEmpty */
5156 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJOREMPTY);
5157 + boolean jjtc000 = true;
5158 + jjtree.openNodeScope(jjtn000);EvalItemList list;
5160 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5164 + case QUOTEDSTRING:
5166 + list = SimpleProj(over);
5169 + jj_la1[75] = jj_gen;
5170 + list = new EvalItemList(pigContext);
5172 + jjtree.closeNodeScope(jjtn000, true);
5174 + {if (true) return list;}
5175 + } catch (Throwable jjte000) {
5177 + jjtree.clearNodeScope(jjtn000);
5182 + if (jjte000 instanceof RuntimeException) {
5183 + {if (true) throw (RuntimeException)jjte000;}
5185 + if (jjte000 instanceof ParseException) {
5186 + {if (true) throw (ParseException)jjte000;}
5188 + {if (true) throw (Error)jjte000;}
5191 + jjtree.closeNodeScope(jjtn000, true);
5194 + throw new Error("Missing return statement in function");
5197 +//Just a simple list of projection items
5198 + final public EvalItemList SimpleProj(SchemaItem over) throws ParseException {
5199 + /*@bgen(jjtree) SimpleProj */
5200 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJ);
5201 + boolean jjtc000 = true;
5202 + jjtree.openNodeScope(jjtn000);EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);
5204 + i = PSimpleProjItem(over);
5208 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5213 + jj_la1[76] = jj_gen;
5216 + jj_consume_token(56);
5217 + i = PSimpleProjItem(over);
5220 + jjtree.closeNodeScope(jjtn000, true);
5222 + {if (true) return proj;}
5223 + } catch (Throwable jjte000) {
5225 + jjtree.clearNodeScope(jjtn000);
5230 + if (jjte000 instanceof RuntimeException) {
5231 + {if (true) throw (RuntimeException)jjte000;}
5233 + if (jjte000 instanceof ParseException) {
5234 + {if (true) throw (ParseException)jjte000;}
5236 + {if (true) throw (Error)jjte000;}
5239 + jjtree.closeNodeScope(jjtn000, true);
5242 + throw new Error("Missing return statement in function");
5245 + final public EvalItem PSimpleProjItem(SchemaItem over) throws ParseException {
5246 + /*@bgen(jjtree) PSimpleProjItem */
5247 + SimpleNode jjtn000 = new SimpleNode(JJTPSIMPLEPROJITEM);
5248 + boolean jjtc000 = true;
5249 + jjtree.openNodeScope(jjtn000);EvalItem item;
5251 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5252 + case QUOTEDSTRING:
5258 + item = PColEvalItem(over,null);
5264 + jj_la1[77] = jj_gen;
5265 + jj_consume_token(-1);
5266 + throw new ParseException();
5268 + jjtree.closeNodeScope(jjtn000, true);
5270 + {if (true) return item;}
5271 + } catch (Throwable jjte000) {
5273 + jjtree.clearNodeScope(jjtn000);
5278 + if (jjte000 instanceof RuntimeException) {
5279 + {if (true) throw (RuntimeException)jjte000;}
5281 + if (jjte000 instanceof ParseException) {
5282 + {if (true) throw (ParseException)jjte000;}
5284 + {if (true) throw (Error)jjte000;}
5287 + jjtree.closeNodeScope(jjtn000, true);
5290 + throw new Error("Missing return statement in function");
5293 + final public EvalItem Star() throws ParseException {
5294 + /*@bgen(jjtree) Star */
5295 + SimpleNode jjtn000 = new SimpleNode(JJTSTAR);
5296 + boolean jjtc000 = true;
5297 + jjtree.openNodeScope(jjtn000);Token t1;
5299 + t1 = jj_consume_token(STAR);
5300 + jjtree.closeNodeScope(jjtn000, true);
5302 + {if (true) return new StarEvalItem(pigContext);}
5305 + jjtree.closeNodeScope(jjtn000, true);
5308 + throw new Error("Missing return statement in function");
5311 + final public EvalItem Const() throws ParseException {
5312 + /*@bgen(jjtree) Const */
5313 + SimpleNode jjtn000 = new SimpleNode(JJTCONST);
5314 + boolean jjtc000 = true;
5315 + jjtree.openNodeScope(jjtn000);Token t1;
5317 + t1 = jj_consume_token(QUOTEDSTRING);
5318 + jjtree.closeNodeScope(jjtn000, true);
5320 + {if (true) return new ConstEvalItem(pigContext, unquote(t1.image));}
5323 + jjtree.closeNodeScope(jjtn000, true);
5326 + throw new Error("Missing return statement in function");
5329 + final public EvalItem PColEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
5330 + /*@bgen(jjtree) PColEvalItem */
5331 + SimpleNode jjtn000 = new SimpleNode(JJTPCOLEVALITEM);
5332 + boolean jjtc000 = true;
5333 + jjtree.openNodeScope(jjtn000);EvalItem item;
5335 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5337 + item = DollarVar();
5341 + item = AliasField(over, pipes);
5344 + jj_la1[78] = jj_gen;
5345 + jj_consume_token(-1);
5346 + throw new ParseException();
5348 + jjtree.closeNodeScope(jjtn000, true);
5350 + {if (true) return item;}
5351 + } catch (Throwable jjte000) {
5353 + jjtree.clearNodeScope(jjtn000);
5358 + if (jjte000 instanceof RuntimeException) {
5359 + {if (true) throw (RuntimeException)jjte000;}
5361 + if (jjte000 instanceof ParseException) {
5362 + {if (true) throw (ParseException)jjte000;}
5364 + {if (true) throw (Error)jjte000;}
5367 + jjtree.closeNodeScope(jjtn000, true);
5370 + throw new Error("Missing return statement in function");
5373 + final public ColEvalItem DollarVar() throws ParseException {
5374 + /*@bgen(jjtree) DollarVar */
5375 + SimpleNode jjtn000 = new SimpleNode(JJTDOLLARVAR);
5376 + boolean jjtc000 = true;
5377 + jjtree.openNodeScope(jjtn000);Token t1;
5379 + t1 = jj_consume_token(DOLLARVAR);
5380 + jjtree.closeNodeScope(jjtn000, true);
5382 + {if (true) return new ColEvalItem(pigContext, undollar(t1.image));}
5385 + jjtree.closeNodeScope(jjtn000, true);
5388 + throw new Error("Missing return statement in function");
5391 + final public EvalItem AliasField(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
5392 + /*@bgen(jjtree) AliasField */
5393 + SimpleNode jjtn000 = new SimpleNode(JJTALIASFIELD);
5394 + boolean jjtc000 = true;
5395 + jjtree.openNodeScope(jjtn000);Token t1;
5397 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5399 + t1 = jj_consume_token(GROUP);
5402 + t1 = jj_consume_token(IDENTIFIER);
5405 + jj_la1[79] = jj_gen;
5406 + jj_consume_token(-1);
5407 + throw new ParseException();
5409 + jjtree.closeNodeScope(jjtn000, true);
5411 + int i; EvalItem item = null;
5413 + item = pipes.get(t1.image);
5415 + if (item == null){
5416 + if ( over == null || (i = over.colFor(t1.image)) == -1)
5417 + {if (true) throw new ParseException("Invalid alias: " + t1.image + " in " + over.alias + "--> " + over);}
5418 + item = new ColEvalItem(pigContext, i);
5420 + {if (true) return item;}
5423 + jjtree.closeNodeScope(jjtn000, true);
5426 + throw new Error("Missing return statement in function");
5429 + final private boolean jj_2_1(int xla) {
5430 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5431 + try { return !jj_3_1(); }
5432 + catch(LookaheadSuccess ls) { return true; }
5433 + finally { jj_save(0, xla); }
5436 + final private boolean jj_2_2(int xla) {
5437 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5438 + try { return !jj_3_2(); }
5439 + catch(LookaheadSuccess ls) { return true; }
5440 + finally { jj_save(1, xla); }
5443 + final private boolean jj_2_3(int xla) {
5444 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5445 + try { return !jj_3_3(); }
5446 + catch(LookaheadSuccess ls) { return true; }
5447 + finally { jj_save(2, xla); }
5450 + final private boolean jj_2_4(int xla) {
5451 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5452 + try { return !jj_3_4(); }
5453 + catch(LookaheadSuccess ls) { return true; }
5454 + finally { jj_save(3, xla); }
5457 + final private boolean jj_2_5(int xla) {
5458 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5459 + try { return !jj_3_5(); }
5460 + catch(LookaheadSuccess ls) { return true; }
5461 + finally { jj_save(4, xla); }
5464 + final private boolean jj_2_6(int xla) {
5465 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5466 + try { return !jj_3_6(); }
5467 + catch(LookaheadSuccess ls) { return true; }
5468 + finally { jj_save(5, xla); }
5471 + final private boolean jj_2_7(int xla) {
5472 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5473 + try { return !jj_3_7(); }
5474 + catch(LookaheadSuccess ls) { return true; }
5475 + finally { jj_save(6, xla); }
5478 + final private boolean jj_2_8(int xla) {
5479 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5480 + try { return !jj_3_8(); }
5481 + catch(LookaheadSuccess ls) { return true; }
5482 + finally { jj_save(7, xla); }
5485 + final private boolean jj_2_9(int xla) {
5486 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5487 + try { return !jj_3_9(); }
5488 + catch(LookaheadSuccess ls) { return true; }
5489 + finally { jj_save(8, xla); }
5492 + final private boolean jj_2_10(int xla) {
5493 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5494 + try { return !jj_3_10(); }
5495 + catch(LookaheadSuccess ls) { return true; }
5496 + finally { jj_save(9, xla); }
5499 + final private boolean jj_2_11(int xla) {
5500 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5501 + try { return !jj_3_11(); }
5502 + catch(LookaheadSuccess ls) { return true; }
5503 + finally { jj_save(10, xla); }
5506 + final private boolean jj_2_12(int xla) {
5507 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5508 + try { return !jj_3_12(); }
5509 + catch(LookaheadSuccess ls) { return true; }
5510 + finally { jj_save(11, xla); }
5513 + final private boolean jj_2_13(int xla) {
5514 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5515 + try { return !jj_3_13(); }
5516 + catch(LookaheadSuccess ls) { return true; }
5517 + finally { jj_save(12, xla); }
5520 + final private boolean jj_2_14(int xla) {
5521 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5522 + try { return !jj_3_14(); }
5523 + catch(LookaheadSuccess ls) { return true; }
5524 + finally { jj_save(13, xla); }
5527 + final private boolean jj_2_15(int xla) {
5528 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5529 + try { return !jj_3_15(); }
5530 + catch(LookaheadSuccess ls) { return true; }
5531 + finally { jj_save(14, xla); }
5534 + final private boolean jj_2_16(int xla) {
5535 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5536 + try { return !jj_3_16(); }
5537 + catch(LookaheadSuccess ls) { return true; }
5538 + finally { jj_save(15, xla); }
5541 + final private boolean jj_2_17(int xla) {
5542 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5543 + try { return !jj_3_17(); }
5544 + catch(LookaheadSuccess ls) { return true; }
5545 + finally { jj_save(16, xla); }
5548 + final private boolean jj_2_18(int xla) {
5549 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5550 + try { return !jj_3_18(); }
5551 + catch(LookaheadSuccess ls) { return true; }
5552 + finally { jj_save(17, xla); }
5555 + final private boolean jj_2_19(int xla) {
5556 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5557 + try { return !jj_3_19(); }
5558 + catch(LookaheadSuccess ls) { return true; }
5559 + finally { jj_save(18, xla); }
5562 + final private boolean jj_3R_63() {
5563 + if (jj_3R_85()) return true;
5567 + if (jj_3R_86()) { jj_scanpos = xsp; break; }
5572 + final private boolean jj_3R_121() {
5573 + if (jj_3R_26()) return true;
5574 + if (jj_scan_token(54)) return true;
5575 + if (jj_3R_55()) return true;
5576 + if (jj_scan_token(55)) return true;
5580 + final private boolean jj_3R_120() {
5581 + if (jj_3R_38()) return true;
5582 + if (jj_scan_token(MATCHES)) return true;
5583 + if (jj_scan_token(QUOTEDSTRING)) return true;
5587 + final private boolean jj_3R_119() {
5588 + if (jj_3R_38()) return true;
5589 + if (jj_scan_token(FILTEROP)) return true;
5590 + if (jj_3R_38()) return true;
5594 + final private boolean jj_3R_118() {
5595 + if (jj_3R_129()) return true;
5599 + final private boolean jj_3R_117() {
5600 + if (jj_scan_token(54)) return true;
5601 + if (jj_3R_37()) return true;
5602 + if (jj_scan_token(55)) return true;
5606 + final private boolean jj_3R_99() {
5609 + if (jj_3R_117()) {
5611 + if (jj_3R_118()) {
5613 + if (jj_3R_119()) {
5615 + if (jj_3R_120()) {
5617 + if (jj_3R_121()) return true;
5625 + final private boolean jj_3R_64() {
5626 + if (jj_scan_token(OR)) return true;
5627 + if (jj_3R_63()) return true;
5631 + final private boolean jj_3R_126() {
5634 + if (jj_scan_token(29)) {
5636 + if (jj_scan_token(46)) return true;
5641 + final private boolean jj_3R_42() {
5642 + if (jj_3R_63()) return true;
5646 + if (jj_3R_64()) { jj_scanpos = xsp; break; }
5651 + final private boolean jj_3R_100() {
5652 + if (jj_scan_token(AND)) return true;
5653 + if (jj_3R_99()) return true;
5657 + final private boolean jj_3R_25() {
5658 + if (jj_3R_42()) return true;
5662 + final private boolean jj_3R_35() {
5663 + if (jj_scan_token(DOLLARVAR)) return true;
5667 + final private boolean jj_3R_79() {
5668 + if (jj_3R_99()) return true;
5672 + if (jj_3R_100()) { jj_scanpos = xsp; break; }
5677 + final private boolean jj_3R_116() {
5678 + if (jj_3R_81()) return true;
5682 + final private boolean jj_3R_112() {
5683 + if (jj_3R_126()) return true;
5687 + final private boolean jj_3R_115() {
5688 + if (jj_3R_27()) return true;
5692 + final private boolean jj_3R_111() {
5693 + if (jj_3R_35()) return true;
5697 + final private boolean jj_3R_94() {
5700 + if (jj_3R_115()) {
5702 + if (jj_3R_116()) return true;
5707 + final private boolean jj_3R_91() {
5710 + if (jj_3R_111()) {
5712 + if (jj_3R_112()) return true;
5717 + final private boolean jj_3R_80() {
5718 + if (jj_scan_token(OR)) return true;
5719 + if (jj_3R_79()) return true;
5723 + final private boolean jj_3R_56() {
5724 + if (jj_3R_79()) return true;
5728 + if (jj_3R_80()) { jj_scanpos = xsp; break; }
5733 + final private boolean jj_3R_68() {
5734 + if (jj_scan_token(QUOTEDSTRING)) return true;
5738 + final private boolean jj_3R_74() {
5742 + final private boolean jj_3R_37() {
5743 + if (jj_3R_56()) return true;
5747 + final private boolean jj_3R_95() {
5748 + if (jj_scan_token(56)) return true;
5749 + if (jj_3R_94()) return true;
5753 + final private boolean jj_3R_81() {
5754 + if (jj_scan_token(STAR)) return true;
5758 + final private boolean jj_3R_73() {
5759 + if (jj_3R_94()) return true;
5763 + if (jj_3R_95()) { jj_scanpos = xsp; break; }
5768 + final private boolean jj_3R_48() {
5773 + if (jj_3R_74()) return true;
5778 + final private boolean jj_3R_134() {
5779 + if (jj_3R_81()) return true;
5783 + final private boolean jj_3R_133() {
5784 + if (jj_3R_91()) return true;
5788 + final private boolean jj_3R_30() {
5789 + if (jj_3R_47()) return true;
5790 + if (jj_scan_token(54)) return true;
5791 + if (jj_3R_48()) return true;
5792 + if (jj_scan_token(55)) return true;
5796 + final private boolean jj_3R_139() {
5797 + if (jj_scan_token(56)) return true;
5798 + if (jj_3R_127()) return true;
5802 + final private boolean jj_3R_132() {
5803 + if (jj_3R_68()) return true;
5807 + final private boolean jj_3R_127() {
5810 + if (jj_3R_132()) {
5812 + if (jj_3R_133()) {
5814 + if (jj_3R_134()) return true;
5820 + final private boolean jj_3R_36() {
5821 + if (jj_scan_token(54)) return true;
5822 + if (jj_3R_37()) return true;
5823 + if (jj_scan_token(63)) return true;
5824 + if (jj_3R_38()) return true;
5825 + if (jj_scan_token(64)) return true;
5826 + if (jj_3R_38()) return true;
5827 + if (jj_scan_token(55)) return true;
5831 + final private boolean jj_3_15() {
5832 + if (jj_3R_36()) return true;
5836 + final private boolean jj_3_13() {
5837 + if (jj_3R_34()) return true;
5841 + final private boolean jj_3_14() {
5842 + if (jj_3R_35()) return true;
5846 + final private boolean jj_3R_92() {
5847 + if (jj_scan_token(54)) return true;
5848 + if (jj_3R_25()) return true;
5849 + if (jj_scan_token(63)) return true;
5850 + if (jj_3R_29()) return true;
5851 + if (jj_scan_token(64)) return true;
5852 + if (jj_3R_29()) return true;
5853 + if (jj_scan_token(55)) return true;
5857 + final private boolean jj_3R_72() {
5858 + if (jj_scan_token(62)) return true;
5859 + if (jj_3R_93()) return true;
5863 + final private boolean jj_3R_34() {
5864 + if (jj_3R_47()) return true;
5865 + if (jj_scan_token(54)) return true;
5866 + if (jj_3R_55()) return true;
5867 + if (jj_scan_token(55)) return true;
5871 + final private boolean jj_3R_138() {
5872 + if (jj_3R_127()) return true;
5876 + if (jj_3R_139()) { jj_scanpos = xsp; break; }
5881 + final private boolean jj_3R_124() {
5882 + if (jj_3R_131()) return true;
5886 + final private boolean jj_3_9() {
5887 + if (jj_3R_30()) return true;
5891 + final private boolean jj_3R_103() {
5892 + if (jj_3R_36()) return true;
5896 + final private boolean jj_3R_102() {
5897 + if (jj_3R_35()) return true;
5901 + final private boolean jj_3R_101() {
5902 + if (jj_3R_34()) return true;
5906 + final private boolean jj_3R_82() {
5909 + if (jj_3R_101()) {
5911 + if (jj_3R_102()) {
5913 + if (jj_3R_103()) return true;
5919 + final private boolean jj_3R_128() {
5920 + if (jj_scan_token(56)) return true;
5921 + if (jj_3R_127()) return true;
5925 + final private boolean jj_3R_71() {
5926 + if (jj_3R_92()) return true;
5930 + final private boolean jj_3R_70() {
5931 + if (jj_3R_91()) return true;
5935 + final private boolean jj_3R_69() {
5936 + if (jj_3R_30()) return true;
5940 + final private boolean jj_3R_84() {
5941 + if (jj_scan_token(62)) return true;
5942 + if (jj_scan_token(54)) return true;
5943 + if (jj_3R_81()) return true;
5944 + if (jj_scan_token(55)) return true;
5948 + final private boolean jj_3R_114() {
5949 + if (jj_scan_token(54)) return true;
5950 + if (jj_3R_127()) return true;
5954 + if (jj_3R_128()) { jj_scanpos = xsp; break; }
5956 + if (jj_scan_token(55)) return true;
5960 + final private boolean jj_3R_62() {
5961 + if (jj_scan_token(IDENTIFIER)) return true;
5965 + final private boolean jj_3R_113() {
5966 + if (jj_3R_127()) return true;
5970 + final private boolean jj_3R_93() {
5973 + if (jj_3R_113()) {
5975 + if (jj_3R_114()) return true;
5980 + final private boolean jj_3R_83() {
5981 + if (jj_scan_token(65)) return true;
5982 + if (jj_3R_104()) return true;
5983 + if (jj_scan_token(66)) return true;
5987 + final private boolean jj_3R_46() {
5994 + if (jj_3R_71()) return true;
5998 + if (jj_3R_72()) jj_scanpos = xsp;
6002 + final private boolean jj_3R_45() {
6003 + if (jj_3R_68()) return true;
6007 + final private boolean jj_3R_29() {
6012 + if (jj_3R_46()) return true;
6017 + final private boolean jj_3_8() {
6018 + if (jj_3R_29()) return true;
6022 + final private boolean jj_3R_59() {
6023 + if (jj_3R_82()) return true;
6027 + if (jj_3R_83()) { jj_scanpos = xsp; break; }
6030 + if (jj_3R_84()) jj_scanpos = xsp;
6034 + final private boolean jj_3R_88() {
6035 + if (jj_scan_token(67)) return true;
6036 + if (jj_scan_token(IDENTIFIER)) return true;
6040 + final private boolean jj_3R_41() {
6041 + if (jj_scan_token(54)) return true;
6045 + final private boolean jj_3R_58() {
6046 + if (jj_3R_81()) return true;
6050 + final private boolean jj_3R_87() {
6051 + if (jj_scan_token(62)) return true;
6052 + if (jj_scan_token(IDENTIFIER)) return true;
6056 + final private boolean jj_3_2() {
6057 + if (jj_scan_token(54)) return true;
6058 + if (jj_3R_24()) return true;
6062 + final private boolean jj_3R_57() {
6063 + if (jj_3R_68()) return true;
6067 + final private boolean jj_3R_65() {
6072 + if (jj_3R_88()) return true;
6077 + final private boolean jj_3R_40() {
6078 + if (jj_3R_62()) return true;
6082 + final private boolean jj_3R_38() {
6089 + if (jj_3R_59()) return true;
6095 + final private boolean jj_3R_123() {
6096 + if (jj_scan_token(EVAL)) return true;
6097 + if (jj_3R_55()) return true;
6101 + final private boolean jj_3R_24() {
6108 + if (jj_3R_41()) return true;
6114 + final private boolean jj_3R_43() {
6115 + if (jj_scan_token(IDENTIFIER)) return true;
6119 + if (jj_3R_65()) { jj_scanpos = xsp; break; }
6124 + final private boolean jj_3R_110() {
6125 + if (jj_scan_token(54)) return true;
6126 + if (jj_3R_27()) return true;
6127 + if (jj_scan_token(55)) return true;
6131 + final private boolean jj_3R_78() {
6132 + if (jj_scan_token(56)) return true;
6133 + if (jj_3R_38()) return true;
6137 + final private boolean jj_3R_109() {
6138 + if (jj_3R_29()) return true;
6142 + final private boolean jj_3R_89() {
6145 + if (jj_3R_109()) {
6147 + if (jj_3R_110()) return true;
6152 + final private boolean jj_3R_55() {
6153 + if (jj_3R_38()) return true;
6157 + if (jj_3R_78()) { jj_scanpos = xsp; break; }
6162 + final private boolean jj_3R_137() {
6163 + if (jj_scan_token(DISTINCT)) return true;
6164 + if (jj_3R_138()) return true;
6168 + final private boolean jj_3R_136() {
6169 + if (jj_scan_token(ARRANGE)) return true;
6170 + if (jj_scan_token(BY)) return true;
6171 + if (jj_3R_138()) return true;
6175 + final private boolean jj_3R_135() {
6176 + if (jj_scan_token(ORDER)) return true;
6177 + if (jj_scan_token(BY)) return true;
6178 + if (jj_3R_138()) return true;
6182 + final private boolean jj_3R_131() {
6185 + if (jj_3R_135()) {
6187 + if (jj_3R_136()) {
6189 + if (jj_3R_137()) return true;
6195 + final private boolean jj_3R_26() {
6196 + if (jj_3R_43()) return true;
6200 + final private boolean jj_3R_90() {
6203 + if (jj_scan_token(27)) {
6205 + if (jj_scan_token(61)) return true;
6207 + if (jj_3R_89()) return true;
6211 + final private boolean jj_3_1() {
6212 + if (jj_scan_token(IDENTIFIER)) return true;
6213 + if (jj_scan_token(52)) return true;
6217 + final private boolean jj_3R_130() {
6218 + if (jj_3R_25()) return true;
6222 + final private boolean jj_3R_66() {
6223 + if (jj_3R_89()) return true;
6227 + if (jj_3R_90()) { jj_scanpos = xsp; break; }
6232 + final private boolean jj_3R_122() {
6233 + if (jj_scan_token(FILTER)) return true;
6234 + if (jj_3R_130()) return true;
6238 + final private boolean jj_3R_104() {
6241 + if (jj_3R_122()) {
6243 + if (jj_3R_123()) {
6245 + if (jj_3R_124()) return true;
6251 + final private boolean jj_3R_28() {
6252 + if (jj_3R_43()) return true;
6256 + final private boolean jj_3R_47() {
6257 + if (jj_3R_43()) return true;
6261 + final private boolean jj_3_7() {
6262 + if (jj_3R_28()) return true;
6263 + if (jj_scan_token(54)) return true;
6267 + final private boolean jj_3R_67() {
6270 + if (jj_scan_token(59)) {
6272 + if (jj_scan_token(60)) return true;
6274 + if (jj_3R_66()) return true;
6278 + final private boolean jj_3R_76() {
6279 + if (jj_scan_token(56)) return true;
6280 + if (jj_3R_75()) return true;
6284 + final private boolean jj_3R_61() {
6285 + if (jj_scan_token(HOURS)) return true;
6289 + final private boolean jj_3R_44() {
6290 + if (jj_3R_66()) return true;
6294 + if (jj_3R_67()) { jj_scanpos = xsp; break; }
6299 + final private boolean jj_3R_60() {
6300 + if (jj_scan_token(MINUTES)) return true;
6304 + final private boolean jj_3R_51() {
6308 + final private boolean jj_3R_49() {
6309 + if (jj_scan_token(IDENTIFIER)) return true;
6310 + if (jj_scan_token(64)) return true;
6314 + final private boolean jj_3R_50() {
6315 + if (jj_3R_75()) return true;
6319 + if (jj_3R_76()) { jj_scanpos = xsp; break; }
6324 + final private boolean jj_3R_27() {
6325 + if (jj_3R_44()) return true;
6329 + final private boolean jj_3R_31() {
6332 + if (jj_3R_49()) jj_scanpos = xsp;
6333 + if (jj_scan_token(65)) return true;
6337 + if (jj_3R_51()) return true;
6339 + if (jj_scan_token(66)) return true;
6343 + final private boolean jj_3R_39() {
6344 + if (jj_scan_token(NUMBER)) return true;
6347 + if (jj_scan_token(35)) {
6351 + if (jj_3R_61()) return true;
6357 + final private boolean jj_3_19() {
6358 + if (jj_3R_39()) return true;
6362 + final private boolean jj_3R_77() {
6363 + if (jj_scan_token(56)) return true;
6364 + if (jj_3R_75()) return true;
6368 + final private boolean jj_3R_54() {
6372 + final private boolean jj_3R_125() {
6373 + if (jj_scan_token(NOT)) return true;
6374 + if (jj_3R_85()) return true;
6378 + final private boolean jj_3_5() {
6379 + if (jj_3R_27()) return true;
6380 + if (jj_scan_token(FILTEROP)) return true;
6384 + final private boolean jj_3_4() {
6385 + if (jj_3R_26()) return true;
6386 + if (jj_scan_token(54)) return true;
6390 + final private boolean jj_3_3() {
6391 + if (jj_scan_token(54)) return true;
6392 + if (jj_3R_25()) return true;
6393 + if (jj_scan_token(55)) return true;
6397 + final private boolean jj_3_6() {
6398 + if (jj_3R_27()) return true;
6399 + if (jj_scan_token(MATCHES)) return true;
6400 + if (jj_scan_token(QUOTEDSTRING)) return true;
6404 + final private boolean jj_3R_108() {
6405 + if (jj_3R_27()) return true;
6406 + if (jj_scan_token(FILTEROP)) return true;
6407 + if (jj_3R_27()) return true;
6411 + final private boolean jj_3R_53() {
6412 + if (jj_3R_75()) return true;
6416 + if (jj_3R_77()) { jj_scanpos = xsp; break; }
6421 + final private boolean jj_3R_107() {
6422 + if (jj_3R_125()) return true;
6426 + final private boolean jj_3R_52() {
6429 + if (jj_scan_token(46)) {
6431 + if (jj_scan_token(29)) return true;
6433 + if (jj_scan_token(64)) return true;
6437 + final private boolean jj_3R_106() {
6438 + if (jj_3R_26()) return true;
6439 + if (jj_scan_token(54)) return true;
6440 + if (jj_3R_48()) return true;
6441 + if (jj_scan_token(55)) return true;
6445 + final private boolean jj_3R_32() {
6448 + if (jj_3R_52()) jj_scanpos = xsp;
6449 + if (jj_scan_token(54)) return true;
6453 + if (jj_3R_54()) return true;
6455 + if (jj_scan_token(55)) return true;
6459 + final private boolean jj_3R_105() {
6460 + if (jj_scan_token(54)) return true;
6461 + if (jj_3R_25()) return true;
6462 + if (jj_scan_token(55)) return true;
6466 + final private boolean jj_3_11() {
6467 + if (jj_3R_32()) return true;
6471 + final private boolean jj_3R_85() {
6474 + if (jj_3R_105()) {
6476 + if (jj_3R_106()) {
6478 + if (jj_3R_107()) {
6480 + if (jj_3R_108()) {
6482 + if (jj_3_6()) return true;
6490 + final private boolean jj_3_10() {
6491 + if (jj_3R_31()) return true;
6495 + final private boolean jj_3_12() {
6496 + if (jj_3R_33()) return true;
6500 + final private boolean jj_3R_33() {
6503 + if (jj_scan_token(46)) {
6505 + if (jj_scan_token(29)) return true;
6510 + final private boolean jj_3_18() {
6511 + if (jj_3R_38()) return true;
6512 + if (jj_scan_token(MATCHES)) return true;
6516 + final private boolean jj_3R_129() {
6517 + if (jj_scan_token(NOT)) return true;
6518 + if (jj_3R_99()) return true;
6522 + final private boolean jj_3R_97() {
6523 + if (jj_3R_32()) return true;
6527 + final private boolean jj_3_17() {
6528 + if (jj_3R_38()) return true;
6529 + if (jj_scan_token(FILTEROP)) return true;
6533 + final private boolean jj_3R_96() {
6534 + if (jj_3R_31()) return true;
6538 + final private boolean jj_3R_86() {
6539 + if (jj_scan_token(AND)) return true;
6540 + if (jj_3R_85()) return true;
6544 + final private boolean jj_3R_75() {
6551 + if (jj_3R_98()) return true;
6557 + final private boolean jj_3R_98() {
6558 + if (jj_3R_33()) return true;
6562 + final private boolean jj_3_16() {
6563 + if (jj_scan_token(54)) return true;
6564 + if (jj_3R_37()) return true;
6565 + if (jj_scan_token(55)) return true;
6569 + public QueryParserTokenManager token_source;
6570 + SimpleCharStream jj_input_stream;
6571 + public Token token, jj_nt;
6572 + private int jj_ntk;
6573 + private Token jj_scanpos, jj_lastpos;
6574 + private int jj_la;
6575 + public boolean lookingAhead = false;
6576 + private boolean jj_semLA;
6577 + private int jj_gen;
6578 + final private int[] jj_la1 = new int[80];
6579 + static private int[] jj_la1_0;
6580 + static private int[] jj_la1_1;
6581 + static private int[] jj_la1_2;
6587 + private static void jj_la1_0() {
6588 + jj_la1_0 = new int[] {0x200e1c00,0x400000,0x200e1c00,0x0,0x0,0x400000,0x20020000,0x200e1c00,0x10000000,0x0,0x0,0x1000000,0x0,0x80000000,0x40000000,0x0,0x0,0xb00000,0x6000000,0x6000000,0x28000000,0x6000000,0x6000000,0x0,0x0,0x0,0x0,0x2001c800,0xc000,0x0,0x28000000,0x400000,0x28000000,0x0,0x0,0x8000000,0x8000000,0x0,0x20000000,0x0,0x20000000,0x0,0x28000000,0x28000000,0x20000000,0x20000000,0x0,0x20000000,0x20000000,0x20000000,0x20000000,0x0,0x20000000,0x0,0x0,0x20000000,0x0,0x1c800,0x1c000,0x0,0x0,0x0,0x8000000,0x80000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28000000,0x28000000,0x0,0x28000000,0x20000000,0x20000000,};
6590 + private static void jj_la1_1() {
6591 + jj_la1_1 = new int[] {0x404000,0x0,0x404000,0x4000,0x400000,0x0,0x0,0x0,0x0,0x40000,0x1000000,0x0,0x2,0x0,0x0,0x1,0x1000000,0x0,0x0,0x0,0x4c4000,0x0,0x0,0x1000000,0x1000000,0x4000,0x2000080,0x4c4000,0x0,0x1000000,0x4c4100,0x0,0x4c4000,0x18000000,0x18000000,0x20000000,0x20000000,0x400000,0x484000,0x40000000,0x4c4000,0x1000000,0x4c4000,0x4c4000,0x4000,0x4000,0x1000000,0x404000,0x4000,0x4000,0x4000,0x1000000,0x404000,0x4000,0x1000000,0x404000,0x0,0x200,0x0,0x1000000,0x0,0x40000000,0x4c4000,0x0,0x0,0x1,0x4000,0x8000,0x38,0x40000000,0x40000000,0x40000000,0x40000000,0x1000000,0x4c4000,0xc4000,0x1000000,0xc4000,0x84000,0x4000,};
6593 + private static void jj_la1_2() {
6594 + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x8,0x8,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
6596 + final private JJCalls[] jj_2_rtns = new JJCalls[19];
6597 + private boolean jj_rescan = false;
6598 + private int jj_gc = 0;
6600 + public QueryParser(java.io.InputStream stream) {
6601 + this(stream, null);
6603 + public QueryParser(java.io.InputStream stream, String encoding) {
6604 + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
6605 + token_source = new QueryParserTokenManager(jj_input_stream);
6606 + token = new Token();
6609 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6610 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6613 + public void ReInit(java.io.InputStream stream) {
6614 + ReInit(stream, null);
6616 + public void ReInit(java.io.InputStream stream, String encoding) {
6617 + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
6618 + token_source.ReInit(jj_input_stream);
6619 + token = new Token();
6623 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6624 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6627 + public QueryParser(java.io.Reader stream) {
6628 + jj_input_stream = new SimpleCharStream(stream, 1, 1);
6629 + token_source = new QueryParserTokenManager(jj_input_stream);
6630 + token = new Token();
6633 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6634 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6637 + public void ReInit(java.io.Reader stream) {
6638 + jj_input_stream.ReInit(stream, 1, 1);
6639 + token_source.ReInit(jj_input_stream);
6640 + token = new Token();
6644 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6645 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6648 + public QueryParser(QueryParserTokenManager tm) {
6649 + token_source = tm;
6650 + token = new Token();
6653 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6654 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6657 + public void ReInit(QueryParserTokenManager tm) {
6658 + token_source = tm;
6659 + token = new Token();
6663 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6664 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6667 + final private Token jj_consume_token(int kind) throws ParseException {
6669 + if ((oldToken = token).next != null) token = token.next;
6670 + else token = token.next = token_source.getNextToken();
6672 + if (token.kind == kind) {
6674 + if (++jj_gc > 100) {
6676 + for (int i = 0; i < jj_2_rtns.length; i++) {
6677 + JJCalls c = jj_2_rtns[i];
6678 + while (c != null) {
6679 + if (c.gen < jj_gen) c.first = null;
6688 + throw generateParseException();
6691 + static private final class LookaheadSuccess extends java.lang.Error { }
6692 + final private LookaheadSuccess jj_ls = new LookaheadSuccess();
6693 + final private boolean jj_scan_token(int kind) {
6694 + if (jj_scanpos == jj_lastpos) {
6696 + if (jj_scanpos.next == null) {
6697 + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
6699 + jj_lastpos = jj_scanpos = jj_scanpos.next;
6702 + jj_scanpos = jj_scanpos.next;
6705 + int i = 0; Token tok = token;
6706 + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
6707 + if (tok != null) jj_add_error_token(kind, i);
6709 + if (jj_scanpos.kind != kind) return true;
6710 + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
6714 + final public Token getNextToken() {
6715 + if (token.next != null) token = token.next;
6716 + else token = token.next = token_source.getNextToken();
6722 + final public Token getToken(int index) {
6723 + Token t = lookingAhead ? jj_scanpos : token;
6724 + for (int i = 0; i < index; i++) {
6725 + if (t.next != null) t = t.next;
6726 + else t = t.next = token_source.getNextToken();
6731 + final private int jj_ntk() {
6732 + if ((jj_nt=token.next) == null)
6733 + return (jj_ntk = (token.next=token_source.getNextToken()).kind);
6735 + return (jj_ntk = jj_nt.kind);
6738 + private java.util.Vector jj_expentries = new java.util.Vector();
6739 + private int[] jj_expentry;
6740 + private int jj_kind = -1;
6741 + private int[] jj_lasttokens = new int[100];
6742 + private int jj_endpos;
6744 + private void jj_add_error_token(int kind, int pos) {
6745 + if (pos >= 100) return;
6746 + if (pos == jj_endpos + 1) {
6747 + jj_lasttokens[jj_endpos++] = kind;
6748 + } else if (jj_endpos != 0) {
6749 + jj_expentry = new int[jj_endpos];
6750 + for (int i = 0; i < jj_endpos; i++) {
6751 + jj_expentry[i] = jj_lasttokens[i];
6753 + boolean exists = false;
6754 + for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
6755 + int[] oldentry = (int[])(e.nextElement());
6756 + if (oldentry.length == jj_expentry.length) {
6758 + for (int i = 0; i < jj_expentry.length; i++) {
6759 + if (oldentry[i] != jj_expentry[i]) {
6764 + if (exists) break;
6767 + if (!exists) jj_expentries.addElement(jj_expentry);
6768 + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
6772 + public ParseException generateParseException() {
6773 + jj_expentries.removeAllElements();
6774 + boolean[] la1tokens = new boolean[68];
6775 + for (int i = 0; i < 68; i++) {
6776 + la1tokens[i] = false;
6778 + if (jj_kind >= 0) {
6779 + la1tokens[jj_kind] = true;
6782 + for (int i = 0; i < 80; i++) {
6783 + if (jj_la1[i] == jj_gen) {
6784 + for (int j = 0; j < 32; j++) {
6785 + if ((jj_la1_0[i] & (1<<j)) != 0) {
6786 + la1tokens[j] = true;
6788 + if ((jj_la1_1[i] & (1<<j)) != 0) {
6789 + la1tokens[32+j] = true;
6791 + if ((jj_la1_2[i] & (1<<j)) != 0) {
6792 + la1tokens[64+j] = true;
6797 + for (int i = 0; i < 68; i++) {
6798 + if (la1tokens[i]) {
6799 + jj_expentry = new int[1];
6800 + jj_expentry[0] = i;
6801 + jj_expentries.addElement(jj_expentry);
6805 + jj_rescan_token();
6806 + jj_add_error_token(0, 0);
6807 + int[][] exptokseq = new int[jj_expentries.size()][];
6808 + for (int i = 0; i < jj_expentries.size(); i++) {
6809 + exptokseq[i] = (int[])jj_expentries.elementAt(i);
6811 + return new ParseException(token, exptokseq, tokenImage);
6814 + final public void enable_tracing() {
6817 + final public void disable_tracing() {
6820 + final private void jj_rescan_token() {
6822 + for (int i = 0; i < 19; i++) {
6824 + JJCalls p = jj_2_rtns[i];
6826 + if (p.gen > jj_gen) {
6827 + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
6829 + case 0: jj_3_1(); break;
6830 + case 1: jj_3_2(); break;
6831 + case 2: jj_3_3(); break;
6832 + case 3: jj_3_4(); break;
6833 + case 4: jj_3_5(); break;
6834 + case 5: jj_3_6(); break;
6835 + case 6: jj_3_7(); break;
6836 + case 7: jj_3_8(); break;
6837 + case 8: jj_3_9(); break;
6838 + case 9: jj_3_10(); break;
6839 + case 10: jj_3_11(); break;
6840 + case 11: jj_3_12(); break;
6841 + case 12: jj_3_13(); break;
6842 + case 13: jj_3_14(); break;
6843 + case 14: jj_3_15(); break;
6844 + case 15: jj_3_16(); break;
6845 + case 16: jj_3_17(); break;
6846 + case 17: jj_3_18(); break;
6847 + case 18: jj_3_19(); break;
6851 + } while (p != null);
6852 + } catch(LookaheadSuccess ls) { }
6854 + jj_rescan = false;
6857 + final private void jj_save(int index, int xla) {
6858 + JJCalls p = jj_2_rtns[index];
6859 + while (p.gen > jj_gen) {
6860 + if (p.next == null) { p = p.next = new JJCalls(); break; }
6863 + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
6866 + static final class JJCalls {
6874 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj
6875 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj 1969-12-31 19:00:00.000000000 -0500
6876 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj 2007-08-31 09:41:35.000000000 -0400
6878 +/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj */
6880 + * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
6881 + * See accompanying LICENSE file.
6885 + * This file lists the grammar for PIG Latin.
6886 + * QueryParser program ouputs a ParseTree given a Valid Pig Latin Query
6889 + // Generate non-static functions
6891 + // Case is ignored in keywords
6892 + IGNORE_CASE = true;
6895 +PARSER_BEGIN(QueryParser)
6896 +package com.yahoo.pig.impl.logicalLayer.parser;
6898 +import java.util.*;
6899 +import java.lang.reflect.*;
6900 +import com.yahoo.pig.impl.logicalLayer.*;
6901 +import com.yahoo.pig.impl.eval.*;
6902 +import com.yahoo.pig.impl.eval.func.*;
6903 +import com.yahoo.pig.impl.eval.groupby.*;
6904 +import com.yahoo.pig.impl.eval.filter.*;
6905 +import com.yahoo.pig.impl.eval.window.*;
6906 +import com.yahoo.pig.impl.eval.sad.*;
6907 +import com.yahoo.pig.impl.logicalLayer.schema.*;
6908 +import com.yahoo.pig.*;
6909 +import com.yahoo.pig.impl.PigContext;
6910 +import com.yahoo.pig.PigServer.ExecType;
6911 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
6912 +import com.yahoo.pig.impl.io.FileLocalizer;
6913 +import com.yahoo.pig.builtin.*;
6914 +public class QueryParser/*@bgen(jjtree)*/implements QueryParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
6915 + protected JJTQueryParserState jjtree = new JJTQueryParserState();
6918 + private PigContext pigContext;
6919 + private Map<String, IntermedResult> aliases;
6921 + public QueryParser(InputStream in, PigContext pigContext, Map aliases) {
6923 + this.pigContext = pigContext;
6924 + this.aliases = aliases;
6927 + public class EvalSpecPipeAndSchema{
6928 + EvalSpecPipe pipe;
6929 + SchemaItemList schema;
6932 + public class CogroupInput {
6933 + public LogicalOperator op;
6934 + public GroupBySpec spec;
6937 + static String unquote(String s) {
6938 + return s.substring(1, s.length()-1);
6941 + static int undollar(String s) {
6942 + return Integer.parseInt(s.substring(1, s.length()));
6945 + NestableEvalItem newFuncEvalItem(EvalFunc func, EvalItemList args) throws ParseException {
6946 + if (func instanceof AtomEvalFunc) return new AtomFuncEvalItem(pigContext, (AtomEvalFunc) func, args);
6947 + else if (func instanceof TupleEvalFunc) return new TupleFuncEvalItem(pigContext, (TupleEvalFunc) func, args);
6948 + else if (func instanceof BagEvalFunc) return new BagFuncEvalItem(pigContext, (BagEvalFunc) func, args);
6949 + else throw new ParseException("Error: unknown Eval Function type: " + func.getClass().getName());
6953 + LogicalOperator makeLORead(String alias) throws ParseException {
6954 + if (!aliases.containsKey(alias)) throw new ParseException("Unrecognized alias: " + alias);
6956 + LORead readOp = new LORead(pigContext, aliases.get(alias));
6957 + readOp.alias = alias;
6963 + String massageFilename(String filename) throws IOException {
6964 + if (pigContext.getExecType() != ExecType.LOCAL) {
6965 + if (filename.startsWith(FileLocalizer.LOCAL_PREFIX)) {
6966 + filename = FileLocalizer.hadoopify(filename);
6968 + if (filename.startsWith(FileLocalizer.HADOOP_PREFIX)) {
6969 + filename = filename.substring(FileLocalizer.HADOOP_PREFIX.length());
6977 + LogicalOperator parseCogroup(ArrayList<CogroupInput> gis) throws ParseException{
6978 + int n = gis.size();
6980 + LogicalOperator[] los = new LogicalOperator[n];
6981 + GroupBySpec[] specs = new GroupBySpec[n];
6983 + for (int i = 0; i < n ; i++){
6985 + CogroupInput gi = gis.get(i);
6987 + specs[i] = gi.spec;
6990 + return new LOCogroup(pigContext, los, specs);
6994 + LogicalOperator rewriteCross(ArrayList<LogicalOperator> inputs) throws IOException, ParseException{
6995 + ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
6996 + Iterator<LogicalOperator> iter = inputs.iterator();
6997 + int n = inputs.size();
6999 + EvalSpecPipe pipe = new EvalSpecPipe(pigContext);
7000 + EvalItemList list = new EvalItemList(pigContext);
7002 + for (int i=0; i< n; i++){
7004 + CogroupInput gi = new CogroupInput();
7007 + gi.op = inputs.get(i);
7008 + EvalItemList itemList = new EvalItemList(pigContext);
7009 + itemList.add(new ConstEvalItem(pigContext, n+""));
7010 + itemList.add(new ConstEvalItem(pigContext, i+""));
7011 + gi.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFCross.class.getName()), itemList, false);
7013 + ColEvalItem item = new ColEvalItem(pigContext, i+1);
7014 + EvalItemList subSpec = new EvalItemList(pigContext);
7015 + subSpec.add(new StarEvalItem(pigContext));
7016 + item.subColSpec = subSpec;
7021 + return new LOEval(pigContext, parseCogroup(gis),pipe);
7024 + LOLoad getDefaultLoadOperator(boolean continuous, String filename) throws IOException{
7026 + String[] args = null;
7029 + args = new String[2];
7034 + StorageFunc loadFunc = (StorageFunc) pigContext.getUDF(PigStorage.class.getName());
7035 + return new LOLoad(pigContext, massageFilename(filename), loadFunc, args);
7038 + void assertAtomic(EvalItem item, boolean desiredAtomic) throws ParseException{
7039 + Boolean isAtomic = null;
7040 + if (item instanceof ConstEvalItem || item instanceof AtomFuncEvalItem)
7042 + else if (item instanceof FuncEvalItem)
7045 + if (isAtomic != null && isAtomic != desiredAtomic){
7046 + if (desiredAtomic)
7047 + throw new ParseException("Atomic field expected but found non-atomic field");
7049 + throw new ParseException("Non-atomic field expected but found atomic field");
7053 + EvalItem copyItemAndAddSpec(EvalItem item, EvalSpec spec) throws ParseException{
7054 + assertAtomic(item,false);
7055 + item = item.copy();
7056 + if (!(item instanceof NestableEvalItem))
7057 + throw new ParseException("Internal Error: Cannot add spec to non-nestable field.");
7058 + NestableEvalItem nestableItem = (NestableEvalItem)item;
7059 + EvalSpecPipe specPipe = nestableItem.nestedEval;
7060 + nestableItem.addNestedEvalSpec(spec);
7067 +PARSER_END(QueryParser)
7069 +// Skip all the new lines, tabs and spaces
7070 +SKIP : { " " | "\r" | "\t" | "\n" }
7072 +// Skip comments(single line and multiline)
7074 + <"--"(~["\r","\n"])*>
7075 +| <"/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
7077 +// Comparison operators that can be used in a filter:
7078 +TOKEN : { <#STRFILTEROP : "eq" | "gt" | "lt" | "gte" | "lte" | "neq" > }
7079 +TOKEN : { <#NUMFILTEROP : "==" | "<" | "<=" | ">" | ">=" | "!=" > }
7080 +TOKEN : { <FILTEROP : <STRFILTEROP> | <NUMFILTEROP> > }
7082 +// List all the keywords in the language
7083 +TOKEN : { <LOAD : "load"> }
7084 +TOKEN : { <FILTER : "filter"> }
7085 +TOKEN : { <FOREACH : "foreach"> }
7086 +TOKEN : { <MATCHES : "matches"> }
7087 +TOKEN : { <ORDER : "order"> }
7088 +TOKEN : { <ARRANGE : "arrange"> }
7089 +TOKEN : { <DISTINCT : "distinct"> }
7090 +TOKEN : { <COGROUP : "cogroup"> }
7091 +TOKEN : { <CROSS : "cross"> }
7092 +TOKEN : { <UNION : "union"> }
7093 +TOKEN : { <ALL : "all"> }
7094 +TOKEN : { <ANY : "any"> }
7095 +TOKEN : { <AS : "as"> }
7096 +TOKEN : { <BY : "by"> }
7097 +TOKEN : { <USING : "using"> }
7098 +TOKEN : { <INNER : "inner"> }
7099 +TOKEN : { <OUTER : "outer"> }
7100 +TOKEN : { <STAR : "*"> }
7101 +TOKEN : { <PARALLEL : "parallel"> }
7102 +TOKEN : { <GROUP : "group"> }
7103 +TOKEN : { <AND : "and"> }
7104 +TOKEN : { <OR : "or"> }
7105 +TOKEN : { <NOT : "not"> }
7106 +TOKEN : { <CONTINUOUSLY : "continuously"> }
7107 +TOKEN : { <WINDOW : "window"> }
7108 +TOKEN : { <SECONDS : "seconds"> }
7109 +TOKEN : { <MINUTES : "minutes"> }
7110 +TOKEN : { <HOURS : "hours"> }
7111 +TOKEN : { <TUPLES : "tuples"> }
7112 +TOKEN : { <GENERATE : "generate"> }
7113 +TOKEN : { <FLATTEN : "flatten"> }
7114 +TOKEN : { <EVAL : "eval"> }
7118 + <#LETTER : ["a"-"z", "A"-"Z"] >
7119 +| <#DIGIT : ["0"-"9"] >
7120 +| <#SPECIALCHAR : ["_"] >
7121 +| <#FSSPECIALCHAR: ["-", ":", "/"]>
7122 +| <IDENTIFIER: ( <LETTER> )+ ( <DIGIT> | <LETTER> | <SPECIALCHAR> | "::")* >
7124 +// Define Numeric Constants
7127 + < NUMBER: <INTEGER> | <FLOAT> | <FLOAT> ( ["e","E"] ([ "-","+"])? <FLOAT> )?>
7128 +| < #FLOAT: <INTEGER> ( "." <INTEGER> )? | "." <INTEGER> >
7129 +| < INTEGER: ( <DIGIT> )+ >
7132 +TOKEN : { <QUOTEDSTRING : "'" (~["'"])* "'"> }
7133 +// Pig has special variables starting with $
7134 +TOKEN : { <DOLLARVAR : "$" <INTEGER> > }
7136 +// Parse is the Starting function.
7137 +LogicalPlan Parse() : {/*@bgen(jjtree) Parse */
7138 + SimpleNode jjtn000 = new SimpleNode(JJTPARSE);
7139 + boolean jjtc000 = true;
7140 + jjtree.openNodeScope(jjtn000);
7141 +/*@egen*/LogicalOperator root; Token t1;}
7142 +{/*@bgen(jjtree) Parse */
7147 + (t1 = <IDENTIFIER> "=" root = Expr() ";"{root.alias = t1.image;})
7148 +| (root = Expr() ";")
7149 + )/*@bgen(jjtree)*/
7151 + jjtree.closeNodeScope(jjtn000, true);
7155 + { return new LogicalPlan(root, pigContext); }/*@bgen(jjtree)*/
7156 + } catch (Throwable jjte000) {
7158 + jjtree.clearNodeScope(jjtn000);
7163 + if (jjte000 instanceof RuntimeException) {
7164 + throw (RuntimeException)jjte000;
7166 + if (jjte000 instanceof ParseException) {
7167 + throw (ParseException)jjte000;
7169 + throw (Error)jjte000;
7172 + jjtree.closeNodeScope(jjtn000, true);
7178 +LogicalOperator Expr() : {/*@bgen(jjtree) Expr */
7179 + SimpleNode jjtn000 = new SimpleNode(JJTEXPR);
7180 + boolean jjtc000 = true;
7181 + jjtree.openNodeScope(jjtn000);
7182 +/*@egen*/LogicalOperator op; SchemaItemList schema;}
7183 +{/*@bgen(jjtree) Expr */
7187 + ( op = NestedExpr() [ <AS> schema = AsClause() {op.schema=schema;} ] )
7189 + )/*@bgen(jjtree)*/
7191 + jjtree.closeNodeScope(jjtn000, true);
7195 + {return op;}/*@bgen(jjtree)*/
7196 + } catch (Throwable jjte000) {
7198 + jjtree.clearNodeScope(jjtn000);
7203 + if (jjte000 instanceof RuntimeException) {
7204 + throw (RuntimeException)jjte000;
7206 + if (jjte000 instanceof ParseException) {
7207 + throw (ParseException)jjte000;
7209 + throw (Error)jjte000;
7212 + jjtree.closeNodeScope(jjtn000, true);
7218 +LogicalOperator NestedExpr() : {/*@bgen(jjtree) NestedExpr */
7219 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDEXPR);
7220 + boolean jjtc000 = true;
7221 + jjtree.openNodeScope(jjtn000);
7222 +/*@egen*/LogicalOperator op;}
7223 +{/*@bgen(jjtree) NestedExpr */
7228 +| LOOKAHEAD(2) ( "(" op = NestedExpr() ")" )
7229 +| ( "(" op = BaseExpr() ")" )
7230 + )/*@bgen(jjtree)*/
7232 + jjtree.closeNodeScope(jjtn000, true);
7236 + {return op;}/*@bgen(jjtree)*/
7237 + } catch (Throwable jjte000) {
7239 + jjtree.clearNodeScope(jjtn000);
7244 + if (jjte000 instanceof RuntimeException) {
7245 + throw (RuntimeException)jjte000;
7247 + if (jjte000 instanceof ParseException) {
7248 + throw (ParseException)jjte000;
7250 + throw (Error)jjte000;
7253 + jjtree.closeNodeScope(jjtn000, true);
7259 +// A reference to an alias
7260 +LogicalOperator Alias() : {/*@bgen(jjtree) Alias */
7261 + SimpleNode jjtn000 = new SimpleNode(JJTALIAS);
7262 + boolean jjtc000 = true;
7263 + jjtree.openNodeScope(jjtn000);
7264 +/*@egen*/Token t1; LogicalOperator op;}
7265 +{/*@bgen(jjtree) Alias */
7268 + t1 = <IDENTIFIER>/*@bgen(jjtree)*/
7270 + jjtree.closeNodeScope(jjtn000, true);
7275 + op = makeLORead(t1.image);
7277 + }/*@bgen(jjtree)*/
7280 + jjtree.closeNodeScope(jjtn000, true);
7290 +LogicalOperator BaseExpr() : {/*@bgen(jjtree) BaseExpr */
7291 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEXPR);
7292 + boolean jjtc000 = true;
7293 + jjtree.openNodeScope(jjtn000);
7294 +/*@egen*/LogicalOperator op; SchemaItemList schema; Token t1, t2;}
7295 +{/*@bgen(jjtree) BaseExpr */
7300 + (<LOAD> op = LoadClause() [<AS> schema = AsClause() {op.schema=schema;} ])
7301 +| ((<GROUP> | <COGROUP>) op = CogroupClause())
7302 +| (<FILTER> op = FilterClause())
7303 +| (<CROSS> op = CrossClause())
7304 +| (<UNION> op = UnionClause())
7305 +| (<FOREACH> op = ForEachClause())
7307 + [<PARALLEL> t2=<NUMBER> { op.requestedParallelism = Integer.parseInt(t2.image);} ]
7308 + )/*@bgen(jjtree)*/
7310 + jjtree.closeNodeScope(jjtn000, true);
7314 + {return op;}/*@bgen(jjtree)*/
7315 + } catch (Throwable jjte000) {
7317 + jjtree.clearNodeScope(jjtn000);
7322 + if (jjte000 instanceof RuntimeException) {
7323 + throw (RuntimeException)jjte000;
7325 + if (jjte000 instanceof ParseException) {
7326 + throw (ParseException)jjte000;
7328 + throw (Error)jjte000;
7331 + jjtree.closeNodeScope(jjtn000, true);
7337 +LogicalOperator LoadClause() : {/*@bgen(jjtree) LoadClause */
7338 + SimpleNode jjtn000 = new SimpleNode(JJTLOADCLAUSE);
7339 + boolean jjtc000 = true;
7340 + jjtree.openNodeScope(jjtn000);
7341 +/*@egen*/Token t1, t2; String filename; StorageFunc loadFunc = null;
7342 + ArrayList<String> loadParams = new ArrayList<String>(); LOLoad lo=null; boolean continuous=false;}
7343 +{/*@bgen(jjtree) LoadClause */
7346 + ( t1 = <QUOTEDSTRING> {filename = unquote(t1.image);}
7347 + (<USING> loadFunc = LoadFunction() "(" (t2 = <QUOTEDSTRING> {loadParams.add(t2.image);})?
7348 + ( "," t2 = <QUOTEDSTRING> {loadParams.add(t2.image);})*
7350 + {lo = new LOLoad(pigContext, massageFilename(filename), loadFunc, loadParams);}
7353 + [ <CONTINUOUSLY> {continuous=true;} ]/*@bgen(jjtree)*/
7355 + jjtree.closeNodeScope(jjtn000, true);
7361 + lo = getDefaultLoadOperator(continuous,filename);
7364 + lo.setOutputType(LogicalOperator.MONOTONE);
7366 + }/*@bgen(jjtree)*/
7367 + } catch (Throwable jjte000) {
7369 + jjtree.clearNodeScope(jjtn000);
7374 + if (jjte000 instanceof RuntimeException) {
7375 + throw (RuntimeException)jjte000;
7377 + if (jjte000 instanceof ParseException) {
7378 + throw (ParseException)jjte000;
7380 + throw (Error)jjte000;
7383 + jjtree.closeNodeScope(jjtn000, true);
7389 +LogicalOperator FilterClause():
7390 +{/*@bgen(jjtree) FilterClause */
7391 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERCLAUSE);
7392 + boolean jjtc000 = true;
7393 + jjtree.openNodeScope(jjtn000);
7394 +/*@egen*/Cond cond; LogicalOperator input;}
7395 +{/*@bgen(jjtree) FilterClause */
7398 + input = NestedExpr()
7399 + <BY> cond = PCond(input.outputSchema(),null)/*@bgen(jjtree)*/
7401 + jjtree.closeNodeScope(jjtn000, true);
7406 + EvalSpecPipe specPipe = new EvalSpecPipe(pigContext);
7407 + specPipe.add(new FilterSpec(cond));
7408 + return new LOEval(pigContext, input, specPipe);
7409 + }/*@bgen(jjtree)*/
7410 + } catch (Throwable jjte000) {
7412 + jjtree.clearNodeScope(jjtn000);
7417 + if (jjte000 instanceof RuntimeException) {
7418 + throw (RuntimeException)jjte000;
7420 + if (jjte000 instanceof ParseException) {
7421 + throw (ParseException)jjte000;
7423 + throw (Error)jjte000;
7426 + jjtree.closeNodeScope(jjtn000, true);
7434 +Cond PCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PCond */
7435 + SimpleNode jjtn000 = new SimpleNode(JJTPCOND);
7436 + boolean jjtc000 = true;
7437 + jjtree.openNodeScope(jjtn000);
7438 +/*@egen*/Cond cond = null;}
7439 +{/*@bgen(jjtree) PCond */
7442 + cond = POrCond(over,pipes)/*@bgen(jjtree)*/
7444 + jjtree.closeNodeScope(jjtn000, true);
7448 + {return cond;}/*@bgen(jjtree)*/
7449 + } catch (Throwable jjte000) {
7451 + jjtree.clearNodeScope(jjtn000);
7456 + if (jjte000 instanceof RuntimeException) {
7457 + throw (RuntimeException)jjte000;
7459 + if (jjte000 instanceof ParseException) {
7460 + throw (ParseException)jjte000;
7462 + throw (Error)jjte000;
7465 + jjtree.closeNodeScope(jjtn000, true);
7471 +Cond POrCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) POrCond */
7472 + SimpleNode jjtn000 = new SimpleNode(JJTPORCOND);
7473 + boolean jjtc000 = true;
7474 + jjtree.openNodeScope(jjtn000);
7475 +/*@egen*/Cond cond; List<Cond> cList = new ArrayList<Cond>();}
7476 +{/*@bgen(jjtree) POrCond */
7480 + cond = PAndCond(over,pipes) {cList.add(cond);}
7481 + ( <OR> cond = PAndCond(over,pipes) {cList.add(cond);})*
7482 + )/*@bgen(jjtree)*/
7484 + jjtree.closeNodeScope(jjtn000, true);
7489 + if (cList.size()==1)
7492 + return new OrCond(cList);
7493 + }/*@bgen(jjtree)*/
7494 + } catch (Throwable jjte000) {
7496 + jjtree.clearNodeScope(jjtn000);
7501 + if (jjte000 instanceof RuntimeException) {
7502 + throw (RuntimeException)jjte000;
7504 + if (jjte000 instanceof ParseException) {
7505 + throw (ParseException)jjte000;
7507 + throw (Error)jjte000;
7510 + jjtree.closeNodeScope(jjtn000, true);
7516 +Cond PAndCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PAndCond */
7517 + SimpleNode jjtn000 = new SimpleNode(JJTPANDCOND);
7518 + boolean jjtc000 = true;
7519 + jjtree.openNodeScope(jjtn000);
7520 +/*@egen*/Cond cond = null; List<Cond> cList = new ArrayList<Cond>();}
7521 +{/*@bgen(jjtree) PAndCond */
7525 + cond = PUnaryCond(over,pipes) {cList.add(cond);}
7526 + ( <AND> cond = PUnaryCond(over,pipes) {cList.add(cond);} )*
7527 + )/*@bgen(jjtree)*/
7529 + jjtree.closeNodeScope(jjtn000, true);
7534 + if (cList.size()==1)
7537 + return new AndCond(cList);
7538 + }/*@bgen(jjtree)*/
7539 + } catch (Throwable jjte000) {
7541 + jjtree.clearNodeScope(jjtn000);
7546 + if (jjte000 instanceof RuntimeException) {
7547 + throw (RuntimeException)jjte000;
7549 + if (jjte000 instanceof ParseException) {
7550 + throw (ParseException)jjte000;
7552 + throw (Error)jjte000;
7555 + jjtree.closeNodeScope(jjtn000, true);
7561 +Cond PUnaryCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PUnaryCond */
7562 + SimpleNode jjtn000 = new SimpleNode(JJTPUNARYCOND);
7563 + boolean jjtc000 = true;
7564 + jjtree.openNodeScope(jjtn000);
7565 +/*@egen*/Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;}
7566 +{/*@bgen(jjtree) PUnaryCond */
7570 + LOOKAHEAD("(" PCond(over,pipes) ")")
7571 + ("(" cond = PCond(over,pipes) ")")
7572 +| LOOKAHEAD(FilterFunction() "(") (func=FilterFunction() "(" args=EvalArgs(over,pipes) ")" {cond = new FuncCond(func, args);})
7573 +| cond = PNotCond(over,pipes)
7574 +| LOOKAHEAD(InfixExpr(over,pipes) <FILTEROP>)
7575 + (c1=InfixExpr(over,pipes) t1=<FILTEROP> c2=InfixExpr(over,pipes) {cond = new CompCond(c1, t1.image, c2);})
7577 + (c1=InfixExpr(over,pipes) <MATCHES> t1=<QUOTEDSTRING> {cond = new RegexpCond(c1, unquote(t1.image));})
7578 + )/*@bgen(jjtree)*/
7580 + jjtree.closeNodeScope(jjtn000, true);
7584 + {return cond;}/*@bgen(jjtree)*/
7585 + } catch (Throwable jjte000) {
7587 + jjtree.clearNodeScope(jjtn000);
7592 + if (jjte000 instanceof RuntimeException) {
7593 + throw (RuntimeException)jjte000;
7595 + if (jjte000 instanceof ParseException) {
7596 + throw (ParseException)jjte000;
7598 + throw (Error)jjte000;
7601 + jjtree.closeNodeScope(jjtn000, true);
7607 +Cond PNotCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PNotCond */
7608 + SimpleNode jjtn000 = new SimpleNode(JJTPNOTCOND);
7609 + boolean jjtc000 = true;
7610 + jjtree.openNodeScope(jjtn000);
7612 +{/*@bgen(jjtree) PNotCond */
7615 + <NOT> c1=PUnaryCond(over,pipes)/*@bgen(jjtree)*/
7617 + jjtree.closeNodeScope(jjtn000, true);
7621 + {return new NotCond(c1);}/*@bgen(jjtree)*/
7622 + } catch (Throwable jjte000) {
7624 + jjtree.clearNodeScope(jjtn000);
7629 + if (jjte000 instanceof RuntimeException) {
7630 + throw (RuntimeException)jjte000;
7632 + if (jjte000 instanceof ParseException) {
7633 + throw (ParseException)jjte000;
7635 + throw (Error)jjte000;
7638 + jjtree.closeNodeScope(jjtn000, true);
7646 +LogicalOperator CogroupClause() : {/*@bgen(jjtree) CogroupClause */
7647 + SimpleNode jjtn000 = new SimpleNode(JJTCOGROUPCLAUSE);
7648 + boolean jjtc000 = true;
7649 + jjtree.openNodeScope(jjtn000);
7650 +/*@egen*/CogroupInput gi; ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();}
7651 +{/*@bgen(jjtree) CogroupClause */
7654 + (gi = GroupItem() { gis.add(gi); }
7655 + ("," gi = GroupItem() { gis.add(gi); })*)/*@bgen(jjtree)*/
7657 + jjtree.closeNodeScope(jjtn000, true);
7661 + {return parseCogroup(gis);}/*@bgen(jjtree)*/
7662 + } catch (Throwable jjte000) {
7664 + jjtree.clearNodeScope(jjtn000);
7669 + if (jjte000 instanceof RuntimeException) {
7670 + throw (RuntimeException)jjte000;
7672 + if (jjte000 instanceof ParseException) {
7673 + throw (ParseException)jjte000;
7675 + throw (Error)jjte000;
7678 + jjtree.closeNodeScope(jjtn000, true);
7685 +CogroupInput GroupItem() : {/*@bgen(jjtree) GroupItem */
7686 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPITEM);
7687 + boolean jjtc000 = true;
7688 + jjtree.openNodeScope(jjtn000);
7689 +/*@egen*/LogicalOperator op; GroupFunc groupFunc; CogroupInput cogroupInput = new CogroupInput();}
7690 +{/*@bgen(jjtree) GroupItem */
7694 + cogroupInput.op = NestedExpr()
7697 + ( <BY> cogroupInput.spec = GroupByExpr(cogroupInput.op.outputSchema()) )
7698 +| <ALL> {cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAll.class.getName()), new EvalItemList(pigContext), false);}
7699 +| <ANY> {cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAny.class.getName()), new EvalItemList(pigContext), false);}
7701 + [<INNER> {cogroupInput.spec.isInner = true;} | <OUTER>]
7703 + )/*@bgen(jjtree)*/
7705 + jjtree.closeNodeScope(jjtn000, true);
7709 + {return cogroupInput;}/*@bgen(jjtree)*/
7710 + } catch (Throwable jjte000) {
7712 + jjtree.clearNodeScope(jjtn000);
7717 + if (jjte000 instanceof RuntimeException) {
7718 + throw (RuntimeException)jjte000;
7720 + if (jjte000 instanceof ParseException) {
7721 + throw (ParseException)jjte000;
7723 + throw (Error)jjte000;
7726 + jjtree.closeNodeScope(jjtn000, true);
7732 +GroupBySpec GroupByExpr(SchemaItem over) : {/*@bgen(jjtree) GroupByExpr */
7733 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYEXPR);
7734 + boolean jjtc000 = true;
7735 + jjtree.openNodeScope(jjtn000);
7736 +/*@egen*/Token t1; GroupBySpec spec = null; EvalItem projItem = null; EvalItemList proj = null; String s; GroupFunc func = null;}
7737 +{/*@bgen(jjtree) GroupByExpr */
7741 + LOOKAHEAD(2) (func = GroupFunction() "(" proj = SimpleProjOrEmpty(over) ")" {spec = new GroupBySpec(pigContext, func, proj, false);})
7742 +| (proj = BracketedSimpleProj(over)) {spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFTupleNoop.class.getName()), proj, false);}
7743 + )/*@bgen(jjtree)*/
7745 + jjtree.closeNodeScope(jjtn000, true);
7749 + {return spec;}/*@bgen(jjtree)*/
7750 + } catch (Throwable jjte000) {
7752 + jjtree.clearNodeScope(jjtn000);
7757 + if (jjte000 instanceof RuntimeException) {
7758 + throw (RuntimeException)jjte000;
7760 + if (jjte000 instanceof ParseException) {
7761 + throw (ParseException)jjte000;
7763 + throw (Error)jjte000;
7766 + jjtree.closeNodeScope(jjtn000, true);
7772 +//Used in serialization and deserialization
7773 +GroupBySpec GroupBySpec() : {/*@bgen(jjtree) GroupBySpec */
7774 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYSPEC);
7775 + boolean jjtc000 = true;
7776 + jjtree.openNodeScope(jjtn000);
7777 +/*@egen*/GroupBySpec spec = null;}
7778 +{/*@bgen(jjtree) GroupBySpec */
7781 + (spec = GroupByExpr(null)
7782 + [<INNER> {spec.isInner = true;} | <OUTER>])/*@bgen(jjtree)*/
7784 + jjtree.closeNodeScope(jjtn000, true);
7788 + {return spec;}/*@bgen(jjtree)*/
7789 + } catch (Throwable jjte000) {
7791 + jjtree.clearNodeScope(jjtn000);
7796 + if (jjte000 instanceof RuntimeException) {
7797 + throw (RuntimeException)jjte000;
7799 + if (jjte000 instanceof ParseException) {
7800 + throw (ParseException)jjte000;
7802 + throw (Error)jjte000;
7805 + jjtree.closeNodeScope(jjtn000, true);
7811 +LogicalOperator CrossClause() : {/*@bgen(jjtree) CrossClause */
7812 + SimpleNode jjtn000 = new SimpleNode(JJTCROSSCLAUSE);
7813 + boolean jjtc000 = true;
7814 + jjtree.openNodeScope(jjtn000);
7815 +/*@egen*/LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();}
7816 +{/*@bgen(jjtree) CrossClause */
7820 + op = NestedExpr() { inputs.add(op); }
7821 + ("," op = NestedExpr() { inputs.add(op); })*
7822 + )/*@bgen(jjtree)*/
7824 + jjtree.closeNodeScope(jjtn000, true);
7828 + {return rewriteCross(inputs);}/*@bgen(jjtree)*/
7829 + } catch (Throwable jjte000) {
7831 + jjtree.clearNodeScope(jjtn000);
7836 + if (jjte000 instanceof RuntimeException) {
7837 + throw (RuntimeException)jjte000;
7839 + if (jjte000 instanceof ParseException) {
7840 + throw (ParseException)jjte000;
7842 + throw (Error)jjte000;
7845 + jjtree.closeNodeScope(jjtn000, true);
7851 +LogicalOperator UnionClause() : {/*@bgen(jjtree) UnionClause */
7852 + SimpleNode jjtn000 = new SimpleNode(JJTUNIONCLAUSE);
7853 + boolean jjtc000 = true;
7854 + jjtree.openNodeScope(jjtn000);
7855 +/*@egen*/LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();}
7856 +{/*@bgen(jjtree) UnionClause */
7859 + (op = NestedExpr() { inputs.add(op); }
7860 + ("," op = NestedExpr() { inputs.add(op); })*)/*@bgen(jjtree)*/
7862 + jjtree.closeNodeScope(jjtn000, true);
7866 + {return new LOUnion(pigContext, inputs);}/*@bgen(jjtree)*/
7867 + } catch (Throwable jjte000) {
7869 + jjtree.clearNodeScope(jjtn000);
7874 + if (jjte000 instanceof RuntimeException) {
7875 + throw (RuntimeException)jjte000;
7877 + if (jjte000 instanceof ParseException) {
7878 + throw (ParseException)jjte000;
7880 + throw (Error)jjte000;
7883 + jjtree.closeNodeScope(jjtn000, true);
7890 +LogicalOperator ForEachClause() : {/*@bgen(jjtree) ForEachClause */
7891 + SimpleNode jjtn000 = new SimpleNode(JJTFOREACHCLAUSE);
7892 + boolean jjtc000 = true;
7893 + jjtree.openNodeScope(jjtn000);
7894 +/*@egen*/EvalSpecPipeAndSchema specPipeAndSchema = null; LogicalOperator input, op; }
7895 +{/*@bgen(jjtree) ForEachClause */
7899 + input = NestedExpr()
7900 + specPipeAndSchema = NestedBlock(input.outputSchema())
7901 + )/*@bgen(jjtree)*/
7903 + jjtree.closeNodeScope(jjtn000, true);
7908 + op = new LOEval(pigContext, input, specPipeAndSchema.pipe);
7909 + op.schema = specPipeAndSchema.schema;
7911 + }/*@bgen(jjtree)*/
7912 + } catch (Throwable jjte000) {
7914 + jjtree.clearNodeScope(jjtn000);
7919 + if (jjte000 instanceof RuntimeException) {
7920 + throw (RuntimeException)jjte000;
7922 + if (jjte000 instanceof ParseException) {
7923 + throw (ParseException)jjte000;
7925 + throw (Error)jjte000;
7928 + jjtree.closeNodeScope(jjtn000, true);
7934 +EvalSpecPipeAndSchema NestedBlock(SchemaItem over):
7935 +{/*@bgen(jjtree) NestedBlock */
7936 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDBLOCK);
7937 + boolean jjtc000 = true;
7938 + jjtree.openNodeScope(jjtn000);
7939 +/*@egen*/EvalSpecPipeAndSchema pipeAndSchema; Map<String, EvalItem> pipes = new HashMap<String, EvalItem>();}
7940 +{/*@bgen(jjtree) NestedBlock */
7944 + pipeAndSchema = GenerateStatement(over,pipes)
7945 +| ("{" (NestedCommand(over,pipes) ";")* pipeAndSchema = GenerateStatement(over,pipes) ";" "}")
7946 + )/*@bgen(jjtree)*/
7948 + jjtree.closeNodeScope(jjtn000, true);
7952 + {return pipeAndSchema;}/*@bgen(jjtree)*/
7953 + } catch (Throwable jjte000) {
7955 + jjtree.clearNodeScope(jjtn000);
7960 + if (jjte000 instanceof RuntimeException) {
7961 + throw (RuntimeException)jjte000;
7963 + if (jjte000 instanceof ParseException) {
7964 + throw (ParseException)jjte000;
7966 + throw (Error)jjte000;
7969 + jjtree.closeNodeScope(jjtn000, true);
7975 +void NestedCommand(SchemaItem over, Map<String, EvalItem> pipes):
7976 +{/*@bgen(jjtree) NestedCommand */
7977 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDCOMMAND);
7978 + boolean jjtc000 = true;
7979 + jjtree.openNodeScope(jjtn000);
7980 +/*@egen*/Token t; EvalItem item;}
7981 +{/*@bgen(jjtree) NestedCommand */
7985 + t = <IDENTIFIER> "="
7987 + item = InfixExpr(over,pipes)
7988 +| item = NestedFilter(over,pipes)
7989 +| item = NestedSortOrArrange(over,pipes)
7990 +| item = NestedDistinct(over,pipes)
7992 + )/*@bgen(jjtree)*/
7994 + jjtree.closeNodeScope(jjtn000, true);
7998 + {pipes.put(t.image,item);}/*@bgen(jjtree)*/
7999 + } catch (Throwable jjte000) {
8001 + jjtree.clearNodeScope(jjtn000);
8006 + if (jjte000 instanceof RuntimeException) {
8007 + throw (RuntimeException)jjte000;
8009 + if (jjte000 instanceof ParseException) {
8010 + throw (ParseException)jjte000;
8012 + throw (Error)jjte000;
8015 + jjtree.closeNodeScope(jjtn000, true);
8021 +EvalItem NestedFilter(SchemaItem over, Map<String, EvalItem> pipes):
8022 +{/*@bgen(jjtree) NestedFilter */
8023 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDFILTER);
8024 + boolean jjtc000 = true;
8025 + jjtree.openNodeScope(jjtn000);
8026 +/*@egen*/Cond cond; EvalItem item; SchemaItem subSchema = null;}
8027 +{/*@bgen(jjtree) NestedFilter */
8030 + <FILTER> item = BaseEvalItem(over,pipes) { subSchema = item.mapInputSchema(over); }
8031 + <BY> cond = PCond(subSchema,null)/*@bgen(jjtree)*/
8033 + jjtree.closeNodeScope(jjtn000, true);
8037 + { return copyItemAndAddSpec(item,new FilterSpec(cond)); }/*@bgen(jjtree)*/
8038 + } catch (Throwable jjte000) {
8040 + jjtree.clearNodeScope(jjtn000);
8045 + if (jjte000 instanceof RuntimeException) {
8046 + throw (RuntimeException)jjte000;
8048 + if (jjte000 instanceof ParseException) {
8049 + throw (ParseException)jjte000;
8051 + throw (Error)jjte000;
8054 + jjtree.closeNodeScope(jjtn000, true);
8060 +EvalItem NestedSortOrArrange(SchemaItem over, Map<String, EvalItem> pipes):
8061 +{/*@bgen(jjtree) NestedSortOrArrange */
8062 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDSORTORARRANGE);
8063 + boolean jjtc000 = true;
8064 + jjtree.openNodeScope(jjtn000);
8065 +/*@egen*/EvalItemList list; EvalItem item; SchemaItem subSchema = null; Token t;}
8066 +{/*@bgen(jjtree) NestedSortOrArrange */
8070 + ( t = <ORDER> | t = <ARRANGE> )
8071 + item = BaseEvalItem(over,pipes) { subSchema = item.mapInputSchema(over); }
8072 + <BY> list = SimpleProj(subSchema)
8073 + )/*@bgen(jjtree)*/
8075 + jjtree.closeNodeScope(jjtn000, true);
8079 + { return copyItemAndAddSpec(item,new SortArrangeSpec(list,t.image.equalsIgnoreCase("arrange"))); }/*@bgen(jjtree)*/
8080 + } catch (Throwable jjte000) {
8082 + jjtree.clearNodeScope(jjtn000);
8087 + if (jjte000 instanceof RuntimeException) {
8088 + throw (RuntimeException)jjte000;
8090 + if (jjte000 instanceof ParseException) {
8091 + throw (ParseException)jjte000;
8093 + throw (Error)jjte000;
8096 + jjtree.closeNodeScope(jjtn000, true);
8102 +EvalItem NestedDistinct(SchemaItem over, Map<String, EvalItem> pipes):
8103 +{/*@bgen(jjtree) NestedDistinct */
8104 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDDISTINCT);
8105 + boolean jjtc000 = true;
8106 + jjtree.openNodeScope(jjtn000);
8107 +/*@egen*/EvalItemList list; EvalItem item; LogicalOperator subOp = null; Token t;}
8108 +{/*@bgen(jjtree) NestedDistinct */
8113 + item = BaseEvalItem(over,pipes)
8114 + )/*@bgen(jjtree)*/
8116 + jjtree.closeNodeScope(jjtn000, true);
8121 + list = new EvalItemList(pigContext); list.add(new StarEvalItem(pigContext));
8122 + return copyItemAndAddSpec(item,new DistinctSpec(list));
8123 + }/*@bgen(jjtree)*/
8124 + } catch (Throwable jjte000) {
8126 + jjtree.clearNodeScope(jjtn000);
8131 + if (jjte000 instanceof RuntimeException) {
8132 + throw (RuntimeException)jjte000;
8134 + if (jjte000 instanceof ParseException) {
8135 + throw (ParseException)jjte000;
8137 + throw (Error)jjte000;
8140 + jjtree.closeNodeScope(jjtn000, true);
8147 +EvalSpecPipeAndSchema GenerateStatement(SchemaItem over, Map<String, EvalItem> pipes):
8148 +{/*@bgen(jjtree) GenerateStatement */
8149 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATESTATEMENT);
8150 + boolean jjtc000 = true;
8151 + jjtree.openNodeScope(jjtn000);
8152 +/*@egen*/EvalSpecPipeAndSchema pipeAndSchema = new EvalSpecPipeAndSchema(); EvalSpecPipe pipe = null; SchemaItemList schema;}
8153 +{/*@bgen(jjtree) GenerateStatement */
8158 + pipe = FlattenedGenerateItemList(over,pipes)
8159 + )/*@bgen(jjtree)*/
8161 + jjtree.closeNodeScope(jjtn000, true);
8166 + pipeAndSchema.pipe = pipe;
8167 + return pipeAndSchema;
8168 + }/*@bgen(jjtree)*/
8169 + } catch (Throwable jjte000) {
8171 + jjtree.clearNodeScope(jjtn000);
8176 + if (jjte000 instanceof RuntimeException) {
8177 + throw (RuntimeException)jjte000;
8179 + if (jjte000 instanceof ParseException) {
8180 + throw (ParseException)jjte000;
8182 + throw (Error)jjte000;
8185 + jjtree.closeNodeScope(jjtn000, true);
8191 +EvalSpecPipe FlattenedGenerateItemList(SchemaItem over, Map<String, EvalItem> pipes):
8192 +{/*@bgen(jjtree) FlattenedGenerateItemList */
8193 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEMLIST);
8194 + boolean jjtc000 = true;
8195 + jjtree.openNodeScope(jjtn000);
8196 +/*@egen*/EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
8197 +{/*@bgen(jjtree) FlattenedGenerateItemList */
8201 + item = FlattenedGenerateItem(over,pipes) {list.add(item);}
8202 + ("," item = FlattenedGenerateItem(over,pipes) {list.add(item);})*
8203 + )/*@bgen(jjtree)*/
8205 + jjtree.closeNodeScope(jjtn000, true);
8209 + {pipe.add(list); return pipe;}/*@bgen(jjtree)*/
8210 + } catch (Throwable jjte000) {
8212 + jjtree.clearNodeScope(jjtn000);
8217 + if (jjte000 instanceof RuntimeException) {
8218 + throw (RuntimeException)jjte000;
8220 + if (jjte000 instanceof ParseException) {
8221 + throw (ParseException)jjte000;
8223 + throw (Error)jjte000;
8226 + jjtree.closeNodeScope(jjtn000, true);
8233 +EvalItem FlattenedGenerateItem(SchemaItem over, Map<String, EvalItem> pipes):
8234 +{/*@bgen(jjtree) FlattenedGenerateItem */
8235 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEM);
8236 + boolean jjtc000 = true;
8237 + jjtree.openNodeScope(jjtn000);
8238 +/*@egen*/EvalItem item; SchemaItem schema = null;}
8239 +{/*@bgen(jjtree) FlattenedGenerateItem */
8244 + ( <FLATTEN> "(" item = GenerateItem(over,pipes) ")"
8246 + if (!(item instanceof NestableEvalItem) ||
8247 + (item instanceof AtomFuncEvalItem) ){
8248 + throw new ParseException("Cannot flatten atom field");
8251 + EvalItemList list = new EvalItemList(pigContext);
8252 + list.add(new StarEvalItem(pigContext));
8253 + ((NestableEvalItem)item).subColSpec = list;
8256 +| (item = GenerateItem(over,pipes))
8258 + [ <AS> schema = SchemaElement() ]
8259 + )/*@bgen(jjtree)*/
8261 + jjtree.closeNodeScope(jjtn000, true);
8266 + item.schema = schema;
8268 + }/*@bgen(jjtree)*/
8269 + } catch (Throwable jjte000) {
8271 + jjtree.clearNodeScope(jjtn000);
8276 + if (jjte000 instanceof RuntimeException) {
8277 + throw (RuntimeException)jjte000;
8279 + if (jjte000 instanceof ParseException) {
8280 + throw (ParseException)jjte000;
8282 + throw (Error)jjte000;
8285 + jjtree.closeNodeScope(jjtn000, true);
8291 +EvalItem GenerateItem(SchemaItem over, Map<String, EvalItem> pipes):
8292 +{/*@bgen(jjtree) GenerateItem */
8293 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATEITEM);
8294 + boolean jjtc000 = true;
8295 + jjtree.openNodeScope(jjtn000);
8296 +/*@egen*/EvalItem item;}
8297 +{/*@bgen(jjtree) GenerateItem */
8301 + item = InfixExpr(over,pipes)
8303 + )/*@bgen(jjtree)*/
8305 + jjtree.closeNodeScope(jjtn000, true);
8309 + {return item;}/*@bgen(jjtree)*/
8310 + } catch (Throwable jjte000) {
8312 + jjtree.clearNodeScope(jjtn000);
8317 + if (jjte000 instanceof RuntimeException) {
8318 + throw (RuntimeException)jjte000;
8320 + if (jjte000 instanceof ParseException) {
8321 + throw (ParseException)jjte000;
8323 + throw (Error)jjte000;
8326 + jjtree.closeNodeScope(jjtn000, true);
8333 +EvalItem InfixExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) InfixExpr */
8334 + SimpleNode jjtn000 = new SimpleNode(JJTINFIXEXPR);
8335 + boolean jjtc000 = true;
8336 + jjtree.openNodeScope(jjtn000);
8337 +/*@egen*/ EvalItem expr; }
8338 +{/*@bgen(jjtree) InfixExpr */
8341 + expr = AdditiveExpr(over,pipes)/*@bgen(jjtree)*/
8343 + jjtree.closeNodeScope(jjtn000, true);
8347 + {return expr;}/*@bgen(jjtree)*/
8348 + } catch (Throwable jjte000) {
8350 + jjtree.clearNodeScope(jjtn000);
8355 + if (jjte000 instanceof RuntimeException) {
8356 + throw (RuntimeException)jjte000;
8358 + if (jjte000 instanceof ParseException) {
8359 + throw (ParseException)jjte000;
8361 + throw (Error)jjte000;
8364 + jjtree.closeNodeScope(jjtn000, true);
8370 +EvalItem AdditiveExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) AdditiveExpr */
8371 + SimpleNode jjtn000 = new SimpleNode(JJTADDITIVEEXPR);
8372 + boolean jjtc000 = true;
8373 + jjtree.openNodeScope(jjtn000);
8374 +/*@egen*/ Token t; EvalItem lhs, rhs; EvalItemList args; }
8375 +{/*@bgen(jjtree) AdditiveExpr */
8379 + lhs = MultiplicativeExpr(over,pipes)
8381 + ( t = "+" | t = "-" ) rhs = MultiplicativeExpr(over,pipes)
8384 + assertAtomic(lhs,true);
8385 + assertAtomic(rhs,true);
8386 + args = new EvalItemList(pigContext);
8389 + if (t.image.equals("+")){
8390 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("ADD"), args);
8392 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("SUBTRACT"), args);
8396 + )/*@bgen(jjtree)*/
8398 + jjtree.closeNodeScope(jjtn000, true);
8402 + {return lhs;}/*@bgen(jjtree)*/
8403 + } catch (Throwable jjte000) {
8405 + jjtree.clearNodeScope(jjtn000);
8410 + if (jjte000 instanceof RuntimeException) {
8411 + throw (RuntimeException)jjte000;
8413 + if (jjte000 instanceof ParseException) {
8414 + throw (ParseException)jjte000;
8416 + throw (Error)jjte000;
8419 + jjtree.closeNodeScope(jjtn000, true);
8425 +EvalItem MultiplicativeExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) MultiplicativeExpr */
8426 + SimpleNode jjtn000 = new SimpleNode(JJTMULTIPLICATIVEEXPR);
8427 + boolean jjtc000 = true;
8428 + jjtree.openNodeScope(jjtn000);
8429 +/*@egen*/ Token t; EvalItem lhs, rhs; EvalItemList args; }
8430 +{/*@bgen(jjtree) MultiplicativeExpr */
8434 + lhs = UnaryExpr(over,pipes)
8436 + ( t = <STAR> | t = "/" ) rhs = UnaryExpr(over,pipes)
8438 + assertAtomic(lhs,true);
8439 + assertAtomic(rhs,true);
8440 + args = new EvalItemList(pigContext);
8443 + if (t.image.equals("*")){
8444 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("MULTIPLY"), args);
8446 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("DIVIDE"), args);
8450 + )/*@bgen(jjtree)*/
8452 + jjtree.closeNodeScope(jjtn000, true);
8456 + {return lhs;}/*@bgen(jjtree)*/
8457 + } catch (Throwable jjte000) {
8459 + jjtree.clearNodeScope(jjtn000);
8464 + if (jjte000 instanceof RuntimeException) {
8465 + throw (RuntimeException)jjte000;
8467 + if (jjte000 instanceof ParseException) {
8468 + throw (ParseException)jjte000;
8470 + throw (Error)jjte000;
8473 + jjtree.closeNodeScope(jjtn000, true);
8479 +EvalItem UnaryExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) UnaryExpr */
8480 + SimpleNode jjtn000 = new SimpleNode(JJTUNARYEXPR);
8481 + boolean jjtc000 = true;
8482 + jjtree.openNodeScope(jjtn000);
8483 +/*@egen*/ EvalItem expr; }
8484 +{/*@bgen(jjtree) UnaryExpr */
8488 + LOOKAHEAD(BaseEvalItem(over,pipes)) expr = BaseEvalItem(over,pipes)
8489 +| ( "(" expr = InfixExpr(over,pipes) ")" )
8490 + )/*@bgen(jjtree)*/
8492 + jjtree.closeNodeScope(jjtn000, true);
8496 + {return expr;}/*@bgen(jjtree)*/
8497 + } catch (Throwable jjte000) {
8499 + jjtree.clearNodeScope(jjtn000);
8504 + if (jjte000 instanceof RuntimeException) {
8505 + throw (RuntimeException)jjte000;
8507 + if (jjte000 instanceof ParseException) {
8508 + throw (ParseException)jjte000;
8510 + throw (Error)jjte000;
8513 + jjtree.closeNodeScope(jjtn000, true);
8520 +EvalItem BaseEvalItem(SchemaItem over, Map<String, EvalItem> pipes) :
8521 +{/*@bgen(jjtree) BaseEvalItem */
8522 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEVALITEM);
8523 + boolean jjtc000 = true;
8524 + jjtree.openNodeScope(jjtn000);
8525 +/*@egen*/EvalItem item;EvalItemList projection; SchemaItem subSchema = null;}
8526 +{/*@bgen(jjtree) BaseEvalItem */
8533 + LOOKAHEAD(FuncEvalItem(over,pipes))
8534 + item = FuncEvalItem(over,pipes)
8535 + | item = PColEvalItem(over,pipes)
8536 + | item = BinCond(over,pipes)
8538 + { subSchema = item.mapInputSchema(over); }
8540 + "." projection = BracketedSimpleProj(subSchema)
8542 + assertAtomic(item,false);
8543 + ((NestableEvalItem)item).addNestedEvalSpec(projection);
8547 + )/*@bgen(jjtree)*/
8549 + jjtree.closeNodeScope(jjtn000, true);
8553 + {return item;}/*@bgen(jjtree)*/
8554 + } catch (Throwable jjte000) {
8556 + jjtree.clearNodeScope(jjtn000);
8561 + if (jjte000 instanceof RuntimeException) {
8562 + throw (RuntimeException)jjte000;
8564 + if (jjte000 instanceof ParseException) {
8565 + throw (ParseException)jjte000;
8567 + throw (Error)jjte000;
8570 + jjtree.closeNodeScope(jjtn000, true);
8578 +NestableEvalItem BinCond(SchemaItem over, Map<String, EvalItem> pipes):
8579 +{/*@bgen(jjtree) BinCond */
8580 + SimpleNode jjtn000 = new SimpleNode(JJTBINCOND);
8581 + boolean jjtc000 = true;
8582 + jjtree.openNodeScope(jjtn000);
8583 +/*@egen*/Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;}
8584 +{/*@bgen(jjtree) BinCond */
8588 + "(" cond = PCond(over,pipes) "?" ifTrue = BaseEvalItem(over,pipes)
8589 + ":" ifFalse = BaseEvalItem(over,pipes) ")"
8590 + )/*@bgen(jjtree)*/
8592 + jjtree.closeNodeScope(jjtn000, true);
8596 + { return new BinCond(pigContext, cond,ifTrue,ifFalse);}/*@bgen(jjtree)*/
8597 + } catch (Throwable jjte000) {
8599 + jjtree.clearNodeScope(jjtn000);
8604 + if (jjte000 instanceof RuntimeException) {
8605 + throw (RuntimeException)jjte000;
8607 + if (jjte000 instanceof ParseException) {
8608 + throw (ParseException)jjte000;
8610 + throw (Error)jjte000;
8613 + jjtree.closeNodeScope(jjtn000, true);
8620 +NestableEvalItem FuncEvalItem(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) FuncEvalItem */
8621 + SimpleNode jjtn000 = new SimpleNode(JJTFUNCEVALITEM);
8622 + boolean jjtc000 = true;
8623 + jjtree.openNodeScope(jjtn000);
8624 +/*@egen*/EvalFunc func; EvalItemList args; NestableEvalItem i;}
8625 +{/*@bgen(jjtree) FuncEvalItem */
8628 + func=EvalFunction() "(" args=EvalArgs(over,pipes) ")" {i = newFuncEvalItem(func, args);}/*@bgen(jjtree)*/
8630 + jjtree.closeNodeScope(jjtn000, true);
8634 + {return i;}/*@bgen(jjtree)*/
8635 + } catch (Throwable jjte000) {
8637 + jjtree.clearNodeScope(jjtn000);
8642 + if (jjte000 instanceof RuntimeException) {
8643 + throw (RuntimeException)jjte000;
8645 + if (jjte000 instanceof ParseException) {
8646 + throw (ParseException)jjte000;
8648 + throw (Error)jjte000;
8651 + jjtree.closeNodeScope(jjtn000, true);
8657 +EvalItemList EvalArgs(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) EvalArgs */
8658 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGS);
8659 + boolean jjtc000 = true;
8660 + jjtree.openNodeScope(jjtn000);
8661 +/*@egen*/EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
8662 +{/*@bgen(jjtree) EvalArgs */
8666 + (item=EvalArgsItem(over,pipes) {list.add(item);}
8667 + ("," item=EvalArgsItem(over,pipes) {list.add(item);})*)
8668 + | {list = new EvalItemList(pigContext);}
8669 + )/*@bgen(jjtree)*/
8671 + jjtree.closeNodeScope(jjtn000, true);
8676 + if (!list.isSimple()){
8677 + throw new ParseException("Cannot have non-jave function as an argument");
8680 + }/*@bgen(jjtree)*/
8681 + } catch (Throwable jjte000) {
8683 + jjtree.clearNodeScope(jjtn000);
8688 + if (jjte000 instanceof RuntimeException) {
8689 + throw (RuntimeException)jjte000;
8691 + if (jjte000 instanceof ParseException) {
8692 + throw (ParseException)jjte000;
8694 + throw (Error)jjte000;
8697 + jjtree.closeNodeScope(jjtn000, true);
8703 +EvalItem EvalArgsItem(SchemaItem over, Map<String, EvalItem> pipes):
8704 +{/*@bgen(jjtree) EvalArgsItem */
8705 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGSITEM);
8706 + boolean jjtc000 = true;
8707 + jjtree.openNodeScope(jjtn000);
8708 +/*@egen*/EvalItem item;}
8709 +{/*@bgen(jjtree) EvalArgsItem */
8713 + item = InfixExpr(over,pipes)
8715 + )/*@bgen(jjtree)*/
8717 + jjtree.closeNodeScope(jjtn000, true);
8721 + {return item;}/*@bgen(jjtree)*/
8722 + } catch (Throwable jjte000) {
8724 + jjtree.clearNodeScope(jjtn000);
8729 + if (jjte000 instanceof RuntimeException) {
8730 + throw (RuntimeException)jjte000;
8732 + if (jjte000 instanceof ParseException) {
8733 + throw (ParseException)jjte000;
8735 + throw (Error)jjte000;
8738 + jjtree.closeNodeScope(jjtn000, true);
8747 +// Map a user schema onto a LogicalOperator
8748 +SchemaItemList AsClause() : {/*@bgen(jjtree) AsClause */
8749 + SimpleNode jjtn000 = new SimpleNode(JJTASCLAUSE);
8750 + boolean jjtc000 = true;
8751 + jjtree.openNodeScope(jjtn000);
8752 +/*@egen*/Token t1; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); Token t = null;}
8753 +{/*@bgen(jjtree) AsClause */
8757 + [ ( t = <IDENTIFIER> | t = <GROUP> ) ":" ] "("
8760 + item=SchemaElement() { list.add(item); }
8761 + ( "," item=SchemaElement() { list.add(item); } )*
8764 +| {list = new SchemaItemList();}
8767 + )/*@bgen(jjtree)*/
8769 + jjtree.closeNodeScope(jjtn000, true);
8775 + list.alias = t.image;
8777 + }/*@bgen(jjtree)*/
8778 + } catch (Throwable jjte000) {
8780 + jjtree.clearNodeScope(jjtn000);
8785 + if (jjte000 instanceof RuntimeException) {
8786 + throw (RuntimeException)jjte000;
8788 + if (jjte000 instanceof ParseException) {
8789 + throw (ParseException)jjte000;
8791 + throw (Error)jjte000;
8794 + jjtree.closeNodeScope(jjtn000, true);
8800 +SchemaItem SchemaElement() : {/*@bgen(jjtree) SchemaElement */
8801 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAELEMENT);
8802 + boolean jjtc000 = true;
8803 + jjtree.openNodeScope(jjtn000);
8804 +/*@egen*/ Token t1; SchemaItem item = null;}
8805 +{/*@bgen(jjtree) SchemaElement */
8808 + (LOOKAHEAD(SchemaBag()) item = SchemaBag()
8809 +| LOOKAHEAD(SchemaTuple()) item = SchemaTuple()
8810 +| LOOKAHEAD(SchemaField()) item = SchemaField() )/*@bgen(jjtree)*/
8812 + jjtree.closeNodeScope(jjtn000, true);
8816 + {return item;}/*@bgen(jjtree)*/
8817 + } catch (Throwable jjte000) {
8819 + jjtree.clearNodeScope(jjtn000);
8824 + if (jjte000 instanceof RuntimeException) {
8825 + throw (RuntimeException)jjte000;
8827 + if (jjte000 instanceof ParseException) {
8828 + throw (ParseException)jjte000;
8830 + throw (Error)jjte000;
8833 + jjtree.closeNodeScope(jjtn000, true);
8839 +SchemaItem SchemaField() : {/*@bgen(jjtree) SchemaField */
8840 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAFIELD);
8841 + boolean jjtc000 = true;
8842 + jjtree.openNodeScope(jjtn000);
8843 +/*@egen*/Token t1;}
8844 +{/*@bgen(jjtree) SchemaField */
8847 + ( ( t1 = <IDENTIFIER> | t1 = <GROUP> )/*@bgen(jjtree)*/
8849 + jjtree.closeNodeScope(jjtn000, true);
8852 +/*@egen*/ { return new SchemaField(t1.image); } )/*@bgen(jjtree)*/
8855 + jjtree.closeNodeScope(jjtn000, true);
8861 +SchemaItem SchemaTuple() : {/*@bgen(jjtree) SchemaTuple */
8862 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMATUPLE);
8863 + boolean jjtc000 = true;
8864 + jjtree.openNodeScope(jjtn000);
8865 +/*@egen*/Token t1 = null; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); }
8866 +{/*@bgen(jjtree) SchemaTuple */
8870 + [( t1 = <IDENTIFIER> | t1 = <GROUP> ) ":"] "("
8872 + ( item=SchemaElement() { list.add(item); }
8873 + ( "," item=SchemaElement() {list.add(item);} )*
8878 + )/*@bgen(jjtree)*/
8880 + jjtree.closeNodeScope(jjtn000, true);
8886 + list.alias = t1.image;
8887 + list.setIsBag(false);
8889 + }/*@bgen(jjtree)*/
8890 + } catch (Throwable jjte000) {
8892 + jjtree.clearNodeScope(jjtn000);
8897 + if (jjte000 instanceof RuntimeException) {
8898 + throw (RuntimeException)jjte000;
8900 + if (jjte000 instanceof ParseException) {
8901 + throw (ParseException)jjte000;
8903 + throw (Error)jjte000;
8906 + jjtree.closeNodeScope(jjtn000, true);
8912 +SchemaItem SchemaBag() : {/*@bgen(jjtree) SchemaBag */
8913 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMABAG);
8914 + boolean jjtc000 = true;
8915 + jjtree.openNodeScope(jjtn000);
8916 +/*@egen*/Token t1=null; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); }
8917 +{/*@bgen(jjtree) SchemaBag */
8921 + [ t1 = <IDENTIFIER> ":" ] "["
8923 + ( item=SchemaElement() { list.add(item); }
8924 + ( "," item=SchemaElement() {list.add(item);} )*
8929 + )/*@bgen(jjtree)*/
8931 + jjtree.closeNodeScope(jjtn000, true);
8937 + list.alias = t1.image;
8938 + list.setIsBag(true);
8940 + }/*@bgen(jjtree)*/
8941 + } catch (Throwable jjte000) {
8943 + jjtree.clearNodeScope(jjtn000);
8948 + if (jjte000 instanceof RuntimeException) {
8949 + throw (RuntimeException)jjte000;
8951 + if (jjte000 instanceof ParseException) {
8952 + throw (ParseException)jjte000;
8954 + throw (Error)jjte000;
8957 + jjtree.closeNodeScope(jjtn000, true);
8968 +// Used in serialization and deserialization
8970 +EvalSpecPipe PEvalSpecPipe() : {/*@bgen(jjtree) PEvalSpecPipe */
8971 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPECPIPE);
8972 + boolean jjtc000 = true;
8973 + jjtree.openNodeScope(jjtn000);
8974 +/*@egen*/EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalSpec spec;}
8975 +{/*@bgen(jjtree) PEvalSpecPipe */
8978 +(("["spec=PEvalSpec()"]" {pipe.add(spec);})*)/*@bgen(jjtree)*/
8980 + jjtree.closeNodeScope(jjtn000, true);
8984 + {return pipe;}/*@bgen(jjtree)*/
8985 +} catch (Throwable jjte000) {
8987 + jjtree.clearNodeScope(jjtn000);
8992 + if (jjte000 instanceof RuntimeException) {
8993 + throw (RuntimeException)jjte000;
8995 + if (jjte000 instanceof ParseException) {
8996 + throw (ParseException)jjte000;
8998 + throw (Error)jjte000;
9001 + jjtree.closeNodeScope(jjtn000, true);
9007 +EvalSpec PEvalSpec() : {/*@bgen(jjtree) PEvalSpec */
9008 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPEC);
9009 + boolean jjtc000 = true;
9010 + jjtree.openNodeScope(jjtn000);
9011 +/*@egen*/EvalSpec spec;}
9012 +{/*@bgen(jjtree) PEvalSpec */
9015 + (<FILTER> spec=PFilter() | <EVAL> spec=PEvalItemList() | spec=PSAD())/*@bgen(jjtree)*/
9017 + jjtree.closeNodeScope(jjtn000, true);
9021 + {return spec;}/*@bgen(jjtree)*/
9022 + } catch (Throwable jjte000) {
9024 + jjtree.clearNodeScope(jjtn000);
9029 + if (jjte000 instanceof RuntimeException) {
9030 + throw (RuntimeException)jjte000;
9032 + if (jjte000 instanceof ParseException) {
9033 + throw (ParseException)jjte000;
9035 + throw (Error)jjte000;
9038 + jjtree.closeNodeScope(jjtn000, true);
9044 +EvalSpec PFilter() :
9045 +{/*@bgen(jjtree) PFilter */
9046 + SimpleNode jjtn000 = new SimpleNode(JJTPFILTER);
9047 + boolean jjtc000 = true;
9048 + jjtree.openNodeScope(jjtn000);
9049 +/*@egen*/Cond cond;}
9050 +{/*@bgen(jjtree) PFilter */
9053 + cond = PCond(null,null)/*@bgen(jjtree)*/
9055 + jjtree.closeNodeScope(jjtn000, true);
9059 + {return new FilterSpec(cond);}/*@bgen(jjtree)*/
9060 + } catch (Throwable jjte000) {
9062 + jjtree.clearNodeScope(jjtn000);
9067 + if (jjte000 instanceof RuntimeException) {
9068 + throw (RuntimeException)jjte000;
9070 + if (jjte000 instanceof ParseException) {
9071 + throw (ParseException)jjte000;
9073 + throw (Error)jjte000;
9076 + jjtree.closeNodeScope(jjtn000, true);
9082 +EvalSpec PSAD() : {/*@bgen(jjtree) PSAD */
9083 + SimpleNode jjtn000 = new SimpleNode(JJTPSAD);
9084 + boolean jjtc000 = true;
9085 + jjtree.openNodeScope(jjtn000);
9086 +/*@egen*/EvalSpec sad; EvalItemList proj;}
9087 +{/*@bgen(jjtree) PSAD */
9090 + ((<ORDER> <BY> proj=SimpleProj(null) {sad = new SortArrangeSpec(proj, false);})
9091 +| (<ARRANGE> <BY> proj=SimpleProj(null) {sad = new SortArrangeSpec(proj, true);})
9092 +| (<DISTINCT> proj=SimpleProj(null) {sad = new DistinctSpec(proj);}))/*@bgen(jjtree)*/
9094 + jjtree.closeNodeScope(jjtn000, true);
9098 + {return sad;}/*@bgen(jjtree)*/
9099 + } catch (Throwable jjte000) {
9101 + jjtree.clearNodeScope(jjtn000);
9106 + if (jjte000 instanceof RuntimeException) {
9107 + throw (RuntimeException)jjte000;
9109 + if (jjte000 instanceof ParseException) {
9110 + throw (ParseException)jjte000;
9112 + throw (Error)jjte000;
9115 + jjtree.closeNodeScope(jjtn000, true);
9121 +EvalItemList PEvalItemList() : {/*@bgen(jjtree) PEvalItemList */
9122 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEMLIST);
9123 + boolean jjtc000 = true;
9124 + jjtree.openNodeScope(jjtn000);
9125 +/*@egen*/EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
9126 +{/*@bgen(jjtree) PEvalItemList */
9129 + (item=PEvalItem() {list.add(item);}
9130 + ("," item=PEvalItem() {list.add(item);})*)/*@bgen(jjtree)*/
9132 + jjtree.closeNodeScope(jjtn000, true);
9136 + {return list;}/*@bgen(jjtree)*/
9137 + } catch (Throwable jjte000) {
9139 + jjtree.clearNodeScope(jjtn000);
9144 + if (jjte000 instanceof RuntimeException) {
9145 + throw (RuntimeException)jjte000;
9147 + if (jjte000 instanceof ParseException) {
9148 + throw (ParseException)jjte000;
9150 + throw (Error)jjte000;
9153 + jjtree.closeNodeScope(jjtn000, true);
9159 +EvalItem PEvalItem() : {/*@bgen(jjtree) PEvalItem */
9160 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEM);
9161 + boolean jjtc000 = true;
9162 + jjtree.openNodeScope(jjtn000);
9163 +/*@egen*/EvalItem item; EvalSpec subSpec; EvalItemList subProj; LogicalOperator subOp = null;}
9164 +{/*@bgen(jjtree) PEvalItem */
9171 + item=PNestableEvalItem()
9172 + ( "["subSpec=PEvalSpec()"]" {((NestableEvalItem) item).addNestedEvalSpec(subSpec);})*
9174 + "." "(" Star() ")"
9176 + EvalItemList list = new EvalItemList(pigContext);
9177 + list.add(new StarEvalItem(pigContext));
9178 + ((NestableEvalItem) item).subColSpec = list;
9182 + )/*@bgen(jjtree)*/
9184 + jjtree.closeNodeScope(jjtn000, true);
9188 + {return item;}/*@bgen(jjtree)*/
9189 + } catch (Throwable jjte000) {
9191 + jjtree.clearNodeScope(jjtn000);
9196 + if (jjte000 instanceof RuntimeException) {
9197 + throw (RuntimeException)jjte000;
9199 + if (jjte000 instanceof ParseException) {
9200 + throw (ParseException)jjte000;
9202 + throw (Error)jjte000;
9205 + jjtree.closeNodeScope(jjtn000, true);
9212 +NestableEvalItem PNestableEvalItem() : {/*@bgen(jjtree) PNestableEvalItem */
9213 + SimpleNode jjtn000 = new SimpleNode(JJTPNESTABLEEVALITEM);
9214 + boolean jjtc000 = true;
9215 + jjtree.openNodeScope(jjtn000);
9216 +/*@egen*/NestableEvalItem item;}
9217 +{/*@bgen(jjtree) PNestableEvalItem */
9221 + (LOOKAHEAD(EvalFunctionItem()) item=EvalFunctionItem()
9222 +| LOOKAHEAD(DollarVar()) item=DollarVar()
9223 +| LOOKAHEAD(SerializedBinCond()) item = SerializedBinCond())/*@bgen(jjtree)*/
9225 + jjtree.closeNodeScope(jjtn000, true);
9229 + {return item;}/*@bgen(jjtree)*/
9230 + } catch (Throwable jjte000) {
9232 + jjtree.clearNodeScope(jjtn000);
9237 + if (jjte000 instanceof RuntimeException) {
9238 + throw (RuntimeException)jjte000;
9240 + if (jjte000 instanceof ParseException) {
9241 + throw (ParseException)jjte000;
9243 + throw (Error)jjte000;
9246 + jjtree.closeNodeScope(jjtn000, true);
9252 +NestableEvalItem EvalFunctionItem() : {/*@bgen(jjtree) EvalFunctionItem */
9253 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTIONITEM);
9254 + boolean jjtc000 = true;
9255 + jjtree.openNodeScope(jjtn000);
9256 +/*@egen*/EvalFunc func; EvalItemList args; NestableEvalItem i;}
9257 +{/*@bgen(jjtree) EvalFunctionItem */
9260 + func=EvalFunction() "(" args=PEvalItemList() ")" {i = newFuncEvalItem(func, args);}/*@bgen(jjtree)*/
9262 + jjtree.closeNodeScope(jjtn000, true);
9266 + {return i;}/*@bgen(jjtree)*/
9267 + } catch (Throwable jjte000) {
9269 + jjtree.clearNodeScope(jjtn000);
9274 + if (jjte000 instanceof RuntimeException) {
9275 + throw (RuntimeException)jjte000;
9277 + if (jjte000 instanceof ParseException) {
9278 + throw (ParseException)jjte000;
9280 + throw (Error)jjte000;
9283 + jjtree.closeNodeScope(jjtn000, true);
9290 +NestableEvalItem SerializedBinCond():
9291 +{/*@bgen(jjtree) SerializedBinCond */
9292 + SimpleNode jjtn000 = new SimpleNode(JJTSERIALIZEDBINCOND);
9293 + boolean jjtc000 = true;
9294 + jjtree.openNodeScope(jjtn000);
9295 +/*@egen*/Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;}
9296 +{/*@bgen(jjtree) SerializedBinCond */
9300 + "(" cond = PSerializedCond() "?" ifTrue = PEvalItem()
9301 + ":" ifFalse = PEvalItem() ")"
9302 + )/*@bgen(jjtree)*/
9304 + jjtree.closeNodeScope(jjtn000, true);
9309 + return new BinCond(pigContext, cond,ifTrue,ifFalse);
9310 + }/*@bgen(jjtree)*/
9311 + } catch (Throwable jjte000) {
9313 + jjtree.clearNodeScope(jjtn000);
9318 + if (jjte000 instanceof RuntimeException) {
9319 + throw (RuntimeException)jjte000;
9321 + if (jjte000 instanceof ParseException) {
9322 + throw (ParseException)jjte000;
9324 + throw (Error)jjte000;
9327 + jjtree.closeNodeScope(jjtn000, true);
9334 +Cond PSerializedCond() : {/*@bgen(jjtree) PSerializedCond */
9335 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDCOND);
9336 + boolean jjtc000 = true;
9337 + jjtree.openNodeScope(jjtn000);
9338 +/*@egen*/Cond cond = null;}
9339 +{/*@bgen(jjtree) PSerializedCond */
9342 + cond = PSerializedOrCond()/*@bgen(jjtree)*/
9344 + jjtree.closeNodeScope(jjtn000, true);
9348 + {return cond;}/*@bgen(jjtree)*/
9349 + } catch (Throwable jjte000) {
9351 + jjtree.clearNodeScope(jjtn000);
9356 + if (jjte000 instanceof RuntimeException) {
9357 + throw (RuntimeException)jjte000;
9359 + if (jjte000 instanceof ParseException) {
9360 + throw (ParseException)jjte000;
9362 + throw (Error)jjte000;
9365 + jjtree.closeNodeScope(jjtn000, true);
9371 +Cond PSerializedOrCond() : {/*@bgen(jjtree) PSerializedOrCond */
9372 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDORCOND);
9373 + boolean jjtc000 = true;
9374 + jjtree.openNodeScope(jjtn000);
9375 +/*@egen*/Cond cond; List<Cond> cList = new ArrayList<Cond>();}
9376 +{/*@bgen(jjtree) PSerializedOrCond */
9380 + cond = PSerializedAndCond() {cList.add(cond);}
9381 + ( <OR> cond = PSerializedAndCond() {cList.add(cond);})*
9382 + )/*@bgen(jjtree)*/
9384 + jjtree.closeNodeScope(jjtn000, true);
9389 + if (cList.size()==1)
9392 + return new OrCond(cList);
9393 + }/*@bgen(jjtree)*/
9394 + } catch (Throwable jjte000) {
9396 + jjtree.clearNodeScope(jjtn000);
9401 + if (jjte000 instanceof RuntimeException) {
9402 + throw (RuntimeException)jjte000;
9404 + if (jjte000 instanceof ParseException) {
9405 + throw (ParseException)jjte000;
9407 + throw (Error)jjte000;
9410 + jjtree.closeNodeScope(jjtn000, true);
9416 +Cond PSerializedAndCond() : {/*@bgen(jjtree) PSerializedAndCond */
9417 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDANDCOND);
9418 + boolean jjtc000 = true;
9419 + jjtree.openNodeScope(jjtn000);
9420 +/*@egen*/Cond cond = null; List<Cond> cList = new ArrayList<Cond>();}
9421 +{/*@bgen(jjtree) PSerializedAndCond */
9425 + cond = PSerializedUnaryCond() {cList.add(cond);}
9426 + ( <AND> cond = PSerializedUnaryCond() {cList.add(cond);} )*
9427 + )/*@bgen(jjtree)*/
9429 + jjtree.closeNodeScope(jjtn000, true);
9434 + if (cList.size()==1)
9437 + return new AndCond(cList);
9438 + }/*@bgen(jjtree)*/
9439 + } catch (Throwable jjte000) {
9441 + jjtree.clearNodeScope(jjtn000);
9446 + if (jjte000 instanceof RuntimeException) {
9447 + throw (RuntimeException)jjte000;
9449 + if (jjte000 instanceof ParseException) {
9450 + throw (ParseException)jjte000;
9452 + throw (Error)jjte000;
9455 + jjtree.closeNodeScope(jjtn000, true);
9461 +Cond PSerializedUnaryCond() : {/*@bgen(jjtree) PSerializedUnaryCond */
9462 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDUNARYCOND);
9463 + boolean jjtc000 = true;
9464 + jjtree.openNodeScope(jjtn000);
9465 +/*@egen*/Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;}
9466 +{/*@bgen(jjtree) PSerializedUnaryCond */
9470 + LOOKAHEAD("(" PSerializedCond() ")")
9471 + ("(" cond = PSerializedCond() ")")
9472 +| cond = PSerializedNotCond()
9473 +| LOOKAHEAD(PEvalItem() <FILTEROP>)
9474 + (c1=PEvalItem() t1=<FILTEROP> c2=PEvalItem() {cond = new CompCond(c1, t1.image, c2);})
9475 +| LOOKAHEAD(PEvalItem() <MATCHES>)
9476 + (c1=PEvalItem() <MATCHES> t1=<QUOTEDSTRING> {cond = new RegexpCond(c1, unquote(t1.image));})
9477 +| (func=FilterFunction() "(" args=PEvalItemList() ")" {cond = new FuncCond(func, args);})
9478 + )/*@bgen(jjtree)*/
9480 + jjtree.closeNodeScope(jjtn000, true);
9484 + {return cond;}/*@bgen(jjtree)*/
9485 + } catch (Throwable jjte000) {
9487 + jjtree.clearNodeScope(jjtn000);
9492 + if (jjte000 instanceof RuntimeException) {
9493 + throw (RuntimeException)jjte000;
9495 + if (jjte000 instanceof ParseException) {
9496 + throw (ParseException)jjte000;
9498 + throw (Error)jjte000;
9501 + jjtree.closeNodeScope(jjtn000, true);
9507 +Cond PSerializedNotCond() : {/*@bgen(jjtree) PSerializedNotCond */
9508 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDNOTCOND);
9509 + boolean jjtc000 = true;
9510 + jjtree.openNodeScope(jjtn000);
9512 +{/*@bgen(jjtree) PSerializedNotCond */
9515 + <NOT> c1=PSerializedUnaryCond()/*@bgen(jjtree)*/
9517 + jjtree.closeNodeScope(jjtn000, true);
9521 + {return new NotCond(c1);}/*@bgen(jjtree)*/
9522 + } catch (Throwable jjte000) {
9524 + jjtree.clearNodeScope(jjtn000);
9529 + if (jjte000 instanceof RuntimeException) {
9530 + throw (RuntimeException)jjte000;
9532 + if (jjte000 instanceof ParseException) {
9533 + throw (ParseException)jjte000;
9535 + throw (Error)jjte000;
9538 + jjtree.closeNodeScope(jjtn000, true);
9552 +EvalSpec PWindow() : {/*@bgen(jjtree) PWindow */
9553 + SimpleNode jjtn000 = new SimpleNode(JJTPWINDOW);
9554 + boolean jjtc000 = true;
9555 + jjtree.openNodeScope(jjtn000);
9556 +/*@egen*/EvalSpec spec; int numTuples; double time;}
9557 +{/*@bgen(jjtree) PWindow */
9562 + time = PTimeWindow() { spec = new TimeWindowSpec(WindowSpec.windowType.SLIDING, time); } |
9563 + numTuples = PTupleWindow() { spec = new TupleWindowSpec(WindowSpec.windowType.SLIDING, numTuples);}
9565 + )/*@bgen(jjtree)*/
9567 + jjtree.closeNodeScope(jjtn000, true);
9571 + {return spec;}/*@bgen(jjtree)*/
9572 + } catch (Throwable jjte000) {
9574 + jjtree.clearNodeScope(jjtn000);
9579 + if (jjte000 instanceof RuntimeException) {
9580 + throw (RuntimeException)jjte000;
9582 + if (jjte000 instanceof ParseException) {
9583 + throw (ParseException)jjte000;
9585 + throw (Error)jjte000;
9588 + jjtree.closeNodeScope(jjtn000, true);
9594 +double PTimeWindow() : {/*@bgen(jjtree) PTimeWindow */
9595 + SimpleNode jjtn000 = new SimpleNode(JJTPTIMEWINDOW);
9596 + boolean jjtc000 = true;
9597 + jjtree.openNodeScope(jjtn000);
9598 +/*@egen*/double n; Token t;}
9599 +{/*@bgen(jjtree) PTimeWindow */
9602 + ( t = <NUMBER> { n = Double.parseDouble(t.image); }
9604 + <MINUTES> { n = n*60; } |
9605 + <HOURS> { n = n * 3600; }
9607 + )/*@bgen(jjtree)*/
9609 + jjtree.closeNodeScope(jjtn000, true);
9613 + {return n;}/*@bgen(jjtree)*/
9616 + jjtree.closeNodeScope(jjtn000, true);
9622 +int PTupleWindow() : {/*@bgen(jjtree) PTupleWindow */
9623 + SimpleNode jjtn000 = new SimpleNode(JJTPTUPLEWINDOW);
9624 + boolean jjtc000 = true;
9625 + jjtree.openNodeScope(jjtn000);
9626 +/*@egen*/int n; Token t;}
9627 +{/*@bgen(jjtree) PTupleWindow */
9630 + ( t = <NUMBER> { try{
9631 + n = Integer.parseInt(t.image);
9632 + }catch(NumberFormatException e){
9633 + throw new ParseException("Only whole number tuple windows allowed.");
9637 + )/*@bgen(jjtree)*/
9639 + jjtree.closeNodeScope(jjtn000, true);
9643 + {return n;}/*@bgen(jjtree)*/
9646 + jjtree.closeNodeScope(jjtn000, true);
9658 +// These the simple non-terminals that are shared across many
9660 +EvalFunc EvalFunction() : {/*@bgen(jjtree) EvalFunction */
9661 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTION);
9662 + boolean jjtc000 = true;
9663 + jjtree.openNodeScope(jjtn000);
9664 +/*@egen*/String funcName;}
9665 +{/*@bgen(jjtree) EvalFunction */
9668 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9670 + jjtree.closeNodeScope(jjtn000, true);
9674 + {return (EvalFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9675 + } catch (Throwable jjte000) {
9677 + jjtree.clearNodeScope(jjtn000);
9682 + if (jjte000 instanceof RuntimeException) {
9683 + throw (RuntimeException)jjte000;
9685 + if (jjte000 instanceof ParseException) {
9686 + throw (ParseException)jjte000;
9688 + throw (Error)jjte000;
9691 + jjtree.closeNodeScope(jjtn000, true);
9697 +GroupFunc GroupFunction() : {/*@bgen(jjtree) GroupFunction */
9698 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPFUNCTION);
9699 + boolean jjtc000 = true;
9700 + jjtree.openNodeScope(jjtn000);
9701 +/*@egen*/String funcName;}
9702 +{/*@bgen(jjtree) GroupFunction */
9705 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9707 + jjtree.closeNodeScope(jjtn000, true);
9711 + {return (GroupFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9712 + } catch (Throwable jjte000) {
9714 + jjtree.clearNodeScope(jjtn000);
9719 + if (jjte000 instanceof RuntimeException) {
9720 + throw (RuntimeException)jjte000;
9722 + if (jjte000 instanceof ParseException) {
9723 + throw (ParseException)jjte000;
9725 + throw (Error)jjte000;
9728 + jjtree.closeNodeScope(jjtn000, true);
9734 +StorageFunc LoadFunction() : {/*@bgen(jjtree) LoadFunction */
9735 + SimpleNode jjtn000 = new SimpleNode(JJTLOADFUNCTION);
9736 + boolean jjtc000 = true;
9737 + jjtree.openNodeScope(jjtn000);
9738 +/*@egen*/String funcName;}
9739 +{/*@bgen(jjtree) LoadFunction */
9742 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9744 + jjtree.closeNodeScope(jjtn000, true);
9748 + {return (StorageFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9749 + } catch (Throwable jjte000) {
9751 + jjtree.clearNodeScope(jjtn000);
9756 + if (jjte000 instanceof RuntimeException) {
9757 + throw (RuntimeException)jjte000;
9759 + if (jjte000 instanceof ParseException) {
9760 + throw (ParseException)jjte000;
9762 + throw (Error)jjte000;
9765 + jjtree.closeNodeScope(jjtn000, true);
9771 +FilterFunc FilterFunction() : {/*@bgen(jjtree) FilterFunction */
9772 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERFUNCTION);
9773 + boolean jjtc000 = true;
9774 + jjtree.openNodeScope(jjtn000);
9775 +/*@egen*/String funcName;}
9776 +{/*@bgen(jjtree) FilterFunction */
9779 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9781 + jjtree.closeNodeScope(jjtn000, true);
9785 + {return (FilterFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9786 + } catch (Throwable jjte000) {
9788 + jjtree.clearNodeScope(jjtn000);
9793 + if (jjte000 instanceof RuntimeException) {
9794 + throw (RuntimeException)jjte000;
9796 + if (jjte000 instanceof ParseException) {
9797 + throw (ParseException)jjte000;
9799 + throw (Error)jjte000;
9802 + jjtree.closeNodeScope(jjtn000, true);
9809 + * Bug 831620 - '$' support
9811 +void ClassName() : {} { <IDENTIFIER> (("." <IDENTIFIER>)|("$" <IDENTIFIER>))* }
9814 + * Bug 831620 - '$' support
9816 +String QualifiedFunction() : {Token t1;StringBuffer s=new StringBuffer();}
9818 + ((t1=<IDENTIFIER> { s.append(t1.image);}
9819 + (("." t1=<IDENTIFIER> {s.append("." + t1.image);})|
9820 + ("$" t1=<IDENTIFIER> {s.append("$" + t1.image);}))*))
9821 + {return s.toString();}
9825 +// If there is one time it may not be bracketed, but if multiple, they must be bracketed
9826 +EvalItemList BracketedSimpleProj(SchemaItem over) : {/*@bgen(jjtree) BracketedSimpleProj */
9827 + SimpleNode jjtn000 = new SimpleNode(JJTBRACKETEDSIMPLEPROJ);
9828 + boolean jjtc000 = true;
9829 + jjtree.openNodeScope(jjtn000);
9830 +/*@egen*/EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);}
9831 +{/*@bgen(jjtree) BracketedSimpleProj */
9835 + i = PSimpleProjItem(over) {proj.add(i);}
9836 +| ("(" i = PSimpleProjItem(over) {proj.add(i);}
9837 + ("," i = PSimpleProjItem(over) {proj.add(i);})*
9839 + )/*@bgen(jjtree)*/
9841 + jjtree.closeNodeScope(jjtn000, true);
9845 + {return proj;}/*@bgen(jjtree)*/
9846 + } catch (Throwable jjte000) {
9848 + jjtree.clearNodeScope(jjtn000);
9853 + if (jjte000 instanceof RuntimeException) {
9854 + throw (RuntimeException)jjte000;
9856 + if (jjte000 instanceof ParseException) {
9857 + throw (ParseException)jjte000;
9859 + throw (Error)jjte000;
9862 + jjtree.closeNodeScope(jjtn000, true);
9868 +EvalItemList SimpleProjOrEmpty(SchemaItem over) : {/*@bgen(jjtree) SimpleProjOrEmpty */
9869 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJOREMPTY);
9870 + boolean jjtc000 = true;
9871 + jjtree.openNodeScope(jjtn000);
9872 +/*@egen*/EvalItemList list;}
9873 +{/*@bgen(jjtree) SimpleProjOrEmpty */
9877 + list = SimpleProj(over)
9878 +| {list = new EvalItemList(pigContext);}
9879 + )/*@bgen(jjtree)*/
9881 + jjtree.closeNodeScope(jjtn000, true);
9885 + {return list;}/*@bgen(jjtree)*/
9886 + } catch (Throwable jjte000) {
9888 + jjtree.clearNodeScope(jjtn000);
9893 + if (jjte000 instanceof RuntimeException) {
9894 + throw (RuntimeException)jjte000;
9896 + if (jjte000 instanceof ParseException) {
9897 + throw (ParseException)jjte000;
9899 + throw (Error)jjte000;
9902 + jjtree.closeNodeScope(jjtn000, true);
9908 +//Just a simple list of projection items
9909 +EvalItemList SimpleProj(SchemaItem over) : {/*@bgen(jjtree) SimpleProj */
9910 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJ);
9911 + boolean jjtc000 = true;
9912 + jjtree.openNodeScope(jjtn000);
9913 +/*@egen*/EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);}
9914 +{/*@bgen(jjtree) SimpleProj */
9918 + i = PSimpleProjItem(over) {proj.add(i);}
9919 + ("," i = PSimpleProjItem(over) {proj.add(i);})*
9920 + )/*@bgen(jjtree)*/
9922 + jjtree.closeNodeScope(jjtn000, true);
9926 + {return proj;}/*@bgen(jjtree)*/
9927 + } catch (Throwable jjte000) {
9929 + jjtree.clearNodeScope(jjtn000);
9934 + if (jjte000 instanceof RuntimeException) {
9935 + throw (RuntimeException)jjte000;
9937 + if (jjte000 instanceof ParseException) {
9938 + throw (ParseException)jjte000;
9940 + throw (Error)jjte000;
9943 + jjtree.closeNodeScope(jjtn000, true);
9949 +EvalItem PSimpleProjItem(SchemaItem over):
9950 +{/*@bgen(jjtree) PSimpleProjItem */
9951 + SimpleNode jjtn000 = new SimpleNode(JJTPSIMPLEPROJITEM);
9952 + boolean jjtc000 = true;
9953 + jjtree.openNodeScope(jjtn000);
9954 +/*@egen*/EvalItem item;}
9955 +{/*@bgen(jjtree) PSimpleProjItem */
9960 +| item = PColEvalItem(over,null)
9962 + )/*@bgen(jjtree)*/
9964 + jjtree.closeNodeScope(jjtn000, true);
9968 + {return item;}/*@bgen(jjtree)*/
9969 + } catch (Throwable jjte000) {
9971 + jjtree.clearNodeScope(jjtn000);
9976 + if (jjte000 instanceof RuntimeException) {
9977 + throw (RuntimeException)jjte000;
9979 + if (jjte000 instanceof ParseException) {
9980 + throw (ParseException)jjte000;
9982 + throw (Error)jjte000;
9985 + jjtree.closeNodeScope(jjtn000, true);
9992 +EvalItem Star() : {/*@bgen(jjtree) Star */
9993 + SimpleNode jjtn000 = new SimpleNode(JJTSTAR);
9994 + boolean jjtc000 = true;
9995 + jjtree.openNodeScope(jjtn000);
9996 +/*@egen*/Token t1;}
9997 +{/*@bgen(jjtree) Star */
10000 + t1=<STAR>/*@bgen(jjtree)*/
10002 + jjtree.closeNodeScope(jjtn000, true);
10006 + {return new StarEvalItem(pigContext);}/*@bgen(jjtree)*/
10009 + jjtree.closeNodeScope(jjtn000, true);
10015 +EvalItem Const() : {/*@bgen(jjtree) Const */
10016 + SimpleNode jjtn000 = new SimpleNode(JJTCONST);
10017 + boolean jjtc000 = true;
10018 + jjtree.openNodeScope(jjtn000);
10019 +/*@egen*/Token t1;}
10020 +{/*@bgen(jjtree) Const */
10023 + t1=<QUOTEDSTRING>/*@bgen(jjtree)*/
10025 + jjtree.closeNodeScope(jjtn000, true);
10029 + {return new ConstEvalItem(pigContext, unquote(t1.image));}/*@bgen(jjtree)*/
10032 + jjtree.closeNodeScope(jjtn000, true);
10038 +EvalItem PColEvalItem(SchemaItem over, Map<String, EvalItem> pipes):
10039 +{/*@bgen(jjtree) PColEvalItem */
10040 + SimpleNode jjtn000 = new SimpleNode(JJTPCOLEVALITEM);
10041 + boolean jjtc000 = true;
10042 + jjtree.openNodeScope(jjtn000);
10043 +/*@egen*/EvalItem item;}
10044 +{/*@bgen(jjtree) PColEvalItem */
10048 + item = DollarVar()
10049 +| item = AliasField(over, pipes)
10050 + )/*@bgen(jjtree)*/
10052 + jjtree.closeNodeScope(jjtn000, true);
10058 + }/*@bgen(jjtree)*/
10059 + } catch (Throwable jjte000) {
10061 + jjtree.clearNodeScope(jjtn000);
10064 + jjtree.popNode();
10066 + if (jjte000 instanceof RuntimeException) {
10067 + throw (RuntimeException)jjte000;
10069 + if (jjte000 instanceof ParseException) {
10070 + throw (ParseException)jjte000;
10072 + throw (Error)jjte000;
10075 + jjtree.closeNodeScope(jjtn000, true);
10081 +ColEvalItem DollarVar() : {/*@bgen(jjtree) DollarVar */
10082 + SimpleNode jjtn000 = new SimpleNode(JJTDOLLARVAR);
10083 + boolean jjtc000 = true;
10084 + jjtree.openNodeScope(jjtn000);
10085 +/*@egen*/Token t1;}
10086 +{/*@bgen(jjtree) DollarVar */
10089 + t1=<DOLLARVAR>/*@bgen(jjtree)*/
10091 + jjtree.closeNodeScope(jjtn000, true);
10095 + {return new ColEvalItem(pigContext, undollar(t1.image));}/*@bgen(jjtree)*/
10098 + jjtree.closeNodeScope(jjtn000, true);
10104 +EvalItem AliasField(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) AliasField */
10105 + SimpleNode jjtn000 = new SimpleNode(JJTALIASFIELD);
10106 + boolean jjtc000 = true;
10107 + jjtree.openNodeScope(jjtn000);
10108 +/*@egen*/Token t1;}
10109 +{/*@bgen(jjtree) AliasField */
10112 + (t1=<GROUP> | t1=<IDENTIFIER>)/*@bgen(jjtree)*/
10114 + jjtree.closeNodeScope(jjtn000, true);
10118 + { int i; EvalItem item = null;
10120 + item = pipes.get(t1.image);
10122 + if (item == null){
10123 + if ( over == null || (i = over.colFor(t1.image)) == -1)
10124 + throw new ParseException("Invalid alias: " + t1.image + " in " + over.alias + "--> " + over);
10125 + item = new ColEvalItem(pigContext, i);
10128 + }/*@bgen(jjtree)*/
10131 + jjtree.closeNodeScope(jjtn000, true);
10136 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java
10137 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java 1969-12-31 19:00:00.000000000 -0500
10138 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java 2007-08-31 09:41:35.000000000 -0400
10140 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParserConstants.java */
10141 +package com.yahoo.pig.impl.logicalLayer.parser;
10143 +public interface QueryParserConstants {
10146 + int STRFILTEROP = 7;
10147 + int NUMFILTEROP = 8;
10148 + int FILTEROP = 9;
10151 + int FOREACH = 12;
10152 + int MATCHES = 13;
10154 + int ARRANGE = 15;
10155 + int DISTINCT = 16;
10156 + int COGROUP = 17;
10167 + int PARALLEL = 28;
10172 + int CONTINUOUSLY = 33;
10174 + int SECONDS = 35;
10175 + int MINUTES = 36;
10178 + int GENERATE = 39;
10179 + int FLATTEN = 40;
10183 + int SPECIALCHAR = 44;
10184 + int FSSPECIALCHAR = 45;
10185 + int IDENTIFIER = 46;
10188 + int INTEGER = 49;
10189 + int QUOTEDSTRING = 50;
10190 + int DOLLARVAR = 51;
10194 + String[] tokenImage = {
10200 + "<token of kind 5>",
10201 + "<token of kind 6>",
10228 + "\"continuously\"",
10240 + "<FSSPECIALCHAR>",
10245 + "<QUOTEDSTRING>",
10266 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java
10267 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java 1969-12-31 19:00:00.000000000 -0500
10268 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java 2007-08-31 09:41:35.000000000 -0400
10270 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParserTokenManager.java */
10271 +package com.yahoo.pig.impl.logicalLayer.parser;
10273 +import java.util.*;
10274 +import java.lang.reflect.*;
10275 +import com.yahoo.pig.impl.logicalLayer.*;
10276 +import com.yahoo.pig.impl.eval.*;
10277 +import com.yahoo.pig.impl.eval.func.*;
10278 +import com.yahoo.pig.impl.eval.groupby.*;
10279 +import com.yahoo.pig.impl.eval.filter.*;
10280 +import com.yahoo.pig.impl.eval.window.*;
10281 +import com.yahoo.pig.impl.eval.sad.*;
10282 +import com.yahoo.pig.impl.logicalLayer.schema.*;
10283 +import com.yahoo.pig.*;
10284 +import com.yahoo.pig.impl.PigContext;
10285 +import com.yahoo.pig.PigServer.ExecType;
10286 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
10287 +import com.yahoo.pig.impl.io.FileLocalizer;
10288 +import com.yahoo.pig.builtin.*;
10290 +public class QueryParserTokenManager implements QueryParserConstants
10292 + public java.io.PrintStream debugStream = System.out;
10293 + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
10294 +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
10299 + if ((active0 & 0x400L) != 0L)
10301 + jjmatchedKind = 46;
10304 + if ((active0 & 0x20000000000L) != 0L)
10306 + jjmatchedKind = 46;
10309 + if ((active0 & 0x2000000000000000L) != 0L)
10311 + if ((active0 & 0x100000000L) != 0L)
10313 + jjmatchedKind = 46;
10316 + if ((active0 & 0x1000000000000000L) != 0L)
10318 + if ((active1 & 0x8L) != 0L)
10320 + if ((active0 & 0x10000000000000L) != 0L)
10322 + if ((active0 & 0x8020000000L) != 0L)
10324 + jjmatchedKind = 46;
10327 + if ((active0 & 0x17ed7fff800L) != 0L)
10329 + jjmatchedKind = 46;
10332 + if ((active0 & 0x4000000000000000L) != 0L)
10336 + if ((active0 & 0x80c04000L) != 0L)
10338 + if ((active0 & 0x3ff773fbc00L) != 0L)
10340 + if (jjmatchedPos != 1)
10342 + jjmatchedKind = 46;
10343 + jjmatchedPos = 1;
10349 + if ((active0 & 0x140300000L) != 0L)
10351 + if ((active0 & 0x3fe370ffc00L) != 0L)
10353 + jjmatchedKind = 46;
10354 + jjmatchedPos = 2;
10359 + if ((active0 & 0x20000000400L) != 0L)
10361 + if ((active0 & 0x1fe370ff800L) != 0L)
10363 + jjmatchedKind = 46;
10364 + jjmatchedPos = 3;
10369 + if ((active0 & 0x20270c4000L) != 0L)
10371 + if ((active0 & 0x1de1003b800L) != 0L)
10373 + jjmatchedKind = 46;
10374 + jjmatchedPos = 4;
10379 + if ((active0 & 0x4400000800L) != 0L)
10381 + if ((active0 & 0x19a1003b000L) != 0L)
10383 + jjmatchedKind = 46;
10384 + jjmatchedPos = 5;
10389 + if ((active0 & 0x1180002b000L) != 0L)
10391 + if ((active0 & 0x8210010000L) != 0L)
10393 + jjmatchedKind = 46;
10394 + jjmatchedPos = 6;
10399 + if ((active0 & 0x8010010000L) != 0L)
10401 + if ((active0 & 0x200000000L) != 0L)
10403 + jjmatchedKind = 46;
10404 + jjmatchedPos = 7;
10409 + if ((active0 & 0x200000000L) != 0L)
10411 + jjmatchedKind = 46;
10412 + jjmatchedPos = 8;
10417 + if ((active0 & 0x200000000L) != 0L)
10419 + jjmatchedKind = 46;
10420 + jjmatchedPos = 9;
10425 + if ((active0 & 0x200000000L) != 0L)
10427 + jjmatchedKind = 46;
10428 + jjmatchedPos = 10;
10436 +private final int jjStartNfa_0(int pos, long active0, long active1)
10438 + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
10440 +private final int jjStopAtPos(int pos, int kind)
10442 + jjmatchedKind = kind;
10443 + jjmatchedPos = pos;
10446 +private final int jjStartNfaWithStates_0(int pos, int kind, int state)
10448 + jjmatchedKind = kind;
10449 + jjmatchedPos = pos;
10450 + try { curChar = input_stream.readChar(); }
10451 + catch(java.io.IOException e) { return pos + 1; }
10452 + return jjMoveNfa_0(state, pos + 1);
10454 +private final int jjMoveStringLiteralDfa0_0()
10459 + return jjStartNfaWithStates_0(0, 67, 28);
10461 + return jjStopAtPos(0, 54);
10463 + return jjStopAtPos(0, 55);
10465 + return jjStopAtPos(0, 27);
10467 + return jjStopAtPos(0, 59);
10469 + return jjStopAtPos(0, 56);
10471 + return jjStartNfaWithStates_0(0, 60, 0);
10473 + return jjStartNfaWithStates_0(0, 62, 56);
10475 + return jjStartNfaWithStates_0(0, 61, 3);
10477 + return jjStopAtPos(0, 64);
10479 + return jjStopAtPos(0, 53);
10481 + return jjStartNfaWithStates_0(0, 52, 14);
10483 + return jjStopAtPos(0, 63);
10485 + return jjStopAtPos(0, 65);
10487 + return jjStopAtPos(0, 66);
10490 + return jjMoveStringLiteralDfa1_0(0x40708000L);
10493 + return jjMoveStringLiteralDfa1_0(0x800000L);
10496 + return jjMoveStringLiteralDfa1_0(0x200060000L);
10499 + return jjMoveStringLiteralDfa1_0(0x10000L);
10502 + return jjMoveStringLiteralDfa1_0(0x20000000000L);
10505 + return jjMoveStringLiteralDfa1_0(0x10000001800L);
10508 + return jjMoveStringLiteralDfa1_0(0x8020000000L);
10511 + return jjMoveStringLiteralDfa1_0(0x2000000000L);
10514 + return jjMoveStringLiteralDfa1_0(0x2000000L);
10517 + return jjMoveStringLiteralDfa1_0(0x400L);
10520 + return jjMoveStringLiteralDfa1_0(0x1000002000L);
10523 + return jjMoveStringLiteralDfa1_0(0x100000000L);
10526 + return jjMoveStringLiteralDfa1_0(0x84004000L);
10529 + return jjMoveStringLiteralDfa1_0(0x10000000L);
10532 + return jjMoveStringLiteralDfa1_0(0x800000000L);
10535 + return jjMoveStringLiteralDfa1_0(0x4000000000L);
10538 + return jjMoveStringLiteralDfa1_0(0x1080000L);
10541 + return jjMoveStringLiteralDfa1_0(0x400000000L);
10543 + return jjStopAtPos(0, 57);
10545 + return jjStopAtPos(0, 58);
10547 + return jjMoveNfa_0(2, 0);
10550 +private final int jjMoveStringLiteralDfa1_0(long active0)
10552 + try { curChar = input_stream.readChar(); }
10553 + catch(java.io.IOException e) {
10554 + jjStopStringLiteralDfa_0(0, active0, 0L);
10561 + return jjMoveStringLiteralDfa2_0(active0, 0x10002000L);
10564 + return jjMoveStringLiteralDfa2_0(active0, 0x8800000000L);
10567 + return jjMoveStringLiteralDfa2_0(active0, 0x1400010800L);
10570 + return jjMoveStringLiteralDfa2_0(active0, 0x10000100000L);
10573 + return jjMoveStringLiteralDfa2_0(active0, 0x42280000L);
10576 + return jjMoveStringLiteralDfa2_0(active0, 0x2300021400L);
10579 + if ((active0 & 0x80000000L) != 0L)
10581 + jjmatchedKind = 31;
10582 + jjmatchedPos = 1;
10584 + return jjMoveStringLiteralDfa2_0(active0, 0x2004c000L);
10587 + if ((active0 & 0x400000L) != 0L)
10588 + return jjStartNfaWithStates_0(1, 22, 55);
10589 + return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
10592 + return jjMoveStringLiteralDfa2_0(active0, 0x4004000000L);
10595 + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L);
10598 + if ((active0 & 0x800000L) != 0L)
10599 + return jjStartNfaWithStates_0(1, 23, 55);
10604 + return jjStartNfa_0(0, active0, 0L);
10606 +private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
10608 + if (((active0 &= old0)) == 0L)
10609 + return jjStartNfa_0(0, old0, 0L);
10610 + try { curChar = input_stream.readChar(); }
10611 + catch(java.io.IOException e) {
10612 + jjStopStringLiteralDfa_0(1, active0, 0L);
10619 + return jjMoveStringLiteralDfa3_0(active0, 0x30000000400L);
10622 + return jjMoveStringLiteralDfa3_0(active0, 0x800000000L);
10625 + if ((active0 & 0x40000000L) != 0L)
10626 + return jjStartNfaWithStates_0(2, 30, 55);
10627 + return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
10630 + return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
10633 + return jjMoveStringLiteralDfa3_0(active0, 0x1080000L);
10636 + if ((active0 & 0x100000L) != 0L)
10637 + return jjStartNfaWithStates_0(2, 20, 55);
10638 + return jjMoveStringLiteralDfa3_0(active0, 0x800L);
10641 + return jjMoveStringLiteralDfa3_0(active0, 0x9602000000L);
10644 + return jjMoveStringLiteralDfa3_0(active0, 0x20040000L);
10647 + return jjMoveStringLiteralDfa3_0(active0, 0x4000000000L);
10650 + return jjMoveStringLiteralDfa3_0(active0, 0x10009000L);
10653 + return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
10656 + if ((active0 & 0x100000000L) != 0L)
10657 + return jjStartNfaWithStates_0(2, 32, 55);
10658 + return jjMoveStringLiteralDfa3_0(active0, 0x4002000L);
10661 + return jjMoveStringLiteralDfa3_0(active0, 0x2000000000L);
10664 + if ((active0 & 0x200000L) != 0L)
10665 + return jjStartNfaWithStates_0(2, 21, 55);
10670 + return jjStartNfa_0(1, active0, 0L);
10672 +private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
10674 + if (((active0 &= old0)) == 0L)
10675 + return jjStartNfa_0(1, old0, 0L);
10676 + try { curChar = input_stream.readChar(); }
10677 + catch(java.io.IOException e) {
10678 + jjStopStringLiteralDfa_0(2, active0, 0L);
10685 + return jjMoveStringLiteralDfa4_0(active0, 0x10008000L);
10688 + return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
10691 + if ((active0 & 0x400L) != 0L)
10692 + return jjStartNfaWithStates_0(3, 10, 55);
10693 + return jjMoveStringLiteralDfa4_0(active0, 0x400000000L);
10696 + return jjMoveStringLiteralDfa4_0(active0, 0x8006005000L);
10699 + if ((active0 & 0x20000000000L) != 0L)
10700 + return jjStartNfaWithStates_0(3, 41, 55);
10701 + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000L);
10704 + return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
10707 + return jjMoveStringLiteralDfa4_0(active0, 0x800080000L);
10710 + return jjMoveStringLiteralDfa4_0(active0, 0x2000020000L);
10713 + return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
10716 + return jjMoveStringLiteralDfa4_0(active0, 0x10200010800L);
10719 + return jjMoveStringLiteralDfa4_0(active0, 0x1020000000L);
10723 + return jjStartNfa_0(2, active0, 0L);
10725 +private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
10727 + if (((active0 &= old0)) == 0L)
10728 + return jjStartNfa_0(2, old0, 0L);
10729 + try { curChar = input_stream.readChar(); }
10730 + catch(java.io.IOException e) {
10731 + jjStopStringLiteralDfa_0(3, active0, 0L);
10738 + return jjMoveStringLiteralDfa5_0(active0, 0x1000L);
10741 + return jjMoveStringLiteralDfa5_0(active0, 0x4000000800L);
10744 + if ((active0 & 0x1000000L) != 0L)
10745 + return jjStartNfaWithStates_0(4, 24, 55);
10749 + return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
10752 + return jjMoveStringLiteralDfa5_0(active0, 0x200010000L);
10755 + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L);
10758 + if ((active0 & 0x80000L) != 0L)
10759 + return jjStartNfaWithStates_0(4, 19, 55);
10760 + return jjMoveStringLiteralDfa5_0(active0, 0x800008000L);
10763 + return jjMoveStringLiteralDfa5_0(active0, 0x400020000L);
10766 + if ((active0 & 0x20000000L) != 0L)
10767 + return jjStartNfaWithStates_0(4, 29, 55);
10771 + if ((active0 & 0x4000L) != 0L)
10772 + return jjStartNfaWithStates_0(4, 14, 55);
10773 + else if ((active0 & 0x2000000L) != 0L)
10774 + return jjStartNfaWithStates_0(4, 25, 55);
10775 + else if ((active0 & 0x4000000L) != 0L)
10776 + return jjStartNfaWithStates_0(4, 26, 55);
10777 + return jjMoveStringLiteralDfa5_0(active0, 0x8000000000L);
10780 + if ((active0 & 0x40000L) != 0L)
10781 + return jjStartNfaWithStates_0(4, 18, 55);
10782 + else if ((active0 & 0x2000000000L) != 0L)
10783 + return jjStartNfaWithStates_0(4, 37, 55);
10787 + return jjMoveStringLiteralDfa5_0(active0, 0x11000000000L);
10791 + return jjStartNfa_0(3, active0, 0L);
10793 +private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
10795 + if (((active0 &= old0)) == 0L)
10796 + return jjStartNfa_0(3, old0, 0L);
10797 + try { curChar = input_stream.readChar(); }
10798 + catch(java.io.IOException e) {
10799 + jjStopStringLiteralDfa_0(4, active0, 0L);
10806 + return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L);
10809 + return jjMoveStringLiteralDfa6_0(active0, 0x1000L);
10812 + return jjMoveStringLiteralDfa6_0(active0, 0x800000000L);
10815 + return jjMoveStringLiteralDfa6_0(active0, 0x11000002000L);
10818 + return jjMoveStringLiteralDfa6_0(active0, 0x8000L);
10821 + return jjMoveStringLiteralDfa6_0(active0, 0x10000000L);
10824 + return jjMoveStringLiteralDfa6_0(active0, 0x200010000L);
10827 + if ((active0 & 0x800L) != 0L)
10828 + return jjStartNfaWithStates_0(5, 11, 55);
10832 + if ((active0 & 0x4000000000L) != 0L)
10833 + return jjStartNfaWithStates_0(5, 38, 55);
10837 + return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
10840 + if ((active0 & 0x400000000L) != 0L)
10841 + return jjStartNfaWithStates_0(5, 34, 55);
10846 + return jjStartNfa_0(4, active0, 0L);
10848 +private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
10850 + if (((active0 &= old0)) == 0L)
10851 + return jjStartNfa_0(4, old0, 0L);
10852 + try { curChar = input_stream.readChar(); }
10853 + catch(java.io.IOException e) {
10854 + jjStopStringLiteralDfa_0(5, active0, 0L);
10861 + return jjMoveStringLiteralDfa7_0(active0, 0x10000L);
10864 + if ((active0 & 0x8000L) != 0L)
10865 + return jjStartNfaWithStates_0(6, 15, 55);
10866 + return jjMoveStringLiteralDfa7_0(active0, 0x10000000L);
10869 + if ((active0 & 0x1000L) != 0L)
10870 + return jjStartNfaWithStates_0(6, 12, 55);
10874 + if ((active0 & 0x10000000000L) != 0L)
10875 + return jjStartNfaWithStates_0(6, 40, 55);
10879 + if ((active0 & 0x20000L) != 0L)
10880 + return jjStartNfaWithStates_0(6, 17, 55);
10884 + if ((active0 & 0x2000L) != 0L)
10885 + return jjStartNfaWithStates_0(6, 13, 55);
10886 + else if ((active0 & 0x800000000L) != 0L)
10887 + return jjStartNfaWithStates_0(6, 35, 55);
10888 + else if ((active0 & 0x1000000000L) != 0L)
10889 + return jjStartNfaWithStates_0(6, 36, 55);
10893 + return jjMoveStringLiteralDfa7_0(active0, 0x8000000000L);
10896 + return jjMoveStringLiteralDfa7_0(active0, 0x200000000L);
10900 + return jjStartNfa_0(5, active0, 0L);
10902 +private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
10904 + if (((active0 &= old0)) == 0L)
10905 + return jjStartNfa_0(5, old0, 0L);
10906 + try { curChar = input_stream.readChar(); }
10907 + catch(java.io.IOException e) {
10908 + jjStopStringLiteralDfa_0(6, active0, 0L);
10915 + if ((active0 & 0x8000000000L) != 0L)
10916 + return jjStartNfaWithStates_0(7, 39, 55);
10920 + if ((active0 & 0x10000000L) != 0L)
10921 + return jjStartNfaWithStates_0(7, 28, 55);
10925 + return jjMoveStringLiteralDfa8_0(active0, 0x200000000L);
10928 + if ((active0 & 0x10000L) != 0L)
10929 + return jjStartNfaWithStates_0(7, 16, 55);
10934 + return jjStartNfa_0(6, active0, 0L);
10936 +private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
10938 + if (((active0 &= old0)) == 0L)
10939 + return jjStartNfa_0(6, old0, 0L);
10940 + try { curChar = input_stream.readChar(); }
10941 + catch(java.io.IOException e) {
10942 + jjStopStringLiteralDfa_0(7, active0, 0L);
10949 + return jjMoveStringLiteralDfa9_0(active0, 0x200000000L);
10953 + return jjStartNfa_0(7, active0, 0L);
10955 +private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
10957 + if (((active0 &= old0)) == 0L)
10958 + return jjStartNfa_0(7, old0, 0L);
10959 + try { curChar = input_stream.readChar(); }
10960 + catch(java.io.IOException e) {
10961 + jjStopStringLiteralDfa_0(8, active0, 0L);
10968 + return jjMoveStringLiteralDfa10_0(active0, 0x200000000L);
10972 + return jjStartNfa_0(8, active0, 0L);
10974 +private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
10976 + if (((active0 &= old0)) == 0L)
10977 + return jjStartNfa_0(8, old0, 0L);
10978 + try { curChar = input_stream.readChar(); }
10979 + catch(java.io.IOException e) {
10980 + jjStopStringLiteralDfa_0(9, active0, 0L);
10987 + return jjMoveStringLiteralDfa11_0(active0, 0x200000000L);
10991 + return jjStartNfa_0(9, active0, 0L);
10993 +private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
10995 + if (((active0 &= old0)) == 0L)
10996 + return jjStartNfa_0(9, old0, 0L);
10997 + try { curChar = input_stream.readChar(); }
10998 + catch(java.io.IOException e) {
10999 + jjStopStringLiteralDfa_0(10, active0, 0L);
11006 + if ((active0 & 0x200000000L) != 0L)
11007 + return jjStartNfaWithStates_0(11, 33, 55);
11012 + return jjStartNfa_0(10, active0, 0L);
11014 +private final void jjCheckNAdd(int state)
11016 + if (jjrounds[state] != jjround)
11018 + jjstateSet[jjnewStateCnt++] = state;
11019 + jjrounds[state] = jjround;
11022 +private final void jjAddStates(int start, int end)
11025 + jjstateSet[jjnewStateCnt++] = jjnextStates[start];
11026 + } while (start++ != end);
11028 +private final void jjCheckNAddTwoStates(int state1, int state2)
11030 + jjCheckNAdd(state1);
11031 + jjCheckNAdd(state2);
11033 +private final void jjCheckNAddStates(int start, int end)
11036 + jjCheckNAdd(jjnextStates[start]);
11037 + } while (start++ != end);
11039 +private final void jjCheckNAddStates(int start)
11041 + jjCheckNAdd(jjnextStates[start]);
11042 + jjCheckNAdd(jjnextStates[start + 1]);
11044 +static final long[] jjbitVec0 = {
11045 + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
11047 +private final int jjMoveNfa_0(int startState, int curPos)
11049 + int[] nextStates;
11050 + int startsAt = 0;
11051 + jjnewStateCnt = 54;
11053 + jjstateSet[0] = startState;
11054 + int j, kind = 0x7fffffff;
11057 + if (++jjround == 0x7fffffff)
11059 + if (curChar < 64)
11061 + long l = 1L << curChar;
11064 + switch(jjstateSet[--i])
11067 + if ((0x3ff000000000000L & l) != 0L)
11071 + jjCheckNAddTwoStates(21, 23);
11073 + else if (curChar == 58)
11074 + jjstateSet[jjnewStateCnt++] = 22;
11077 + if ((0x3ff000000000000L & l) != 0L)
11081 + jjCheckNAddTwoStates(21, 23);
11083 + else if (curChar == 58)
11084 + jjstateSet[jjnewStateCnt++] = 22;
11087 + if ((0x3ff000000000000L & l) != 0L)
11091 + jjCheckNAddTwoStates(21, 23);
11093 + else if (curChar == 58)
11094 + jjstateSet[jjnewStateCnt++] = 22;
11097 + if ((0x3ff000000000000L & l) != 0L)
11101 + jjCheckNAddTwoStates(21, 23);
11103 + else if (curChar == 58)
11104 + jjstateSet[jjnewStateCnt++] = 22;
11107 + if ((0x3ff000000000000L & l) != 0L)
11111 + jjCheckNAddTwoStates(21, 23);
11113 + else if (curChar == 58)
11114 + jjstateSet[jjnewStateCnt++] = 22;
11117 + if ((0x3ff000000000000L & l) != 0L)
11123 + if ((0x3ff000000000000L & l) != 0L)
11127 + jjCheckNAddTwoStates(30, 31);
11131 + if ((0x3ff000000000000L & l) != 0L)
11135 + jjCheckNAddStates(0, 6);
11137 + else if ((0x5000000000000000L & l) != 0L)
11142 + else if (curChar == 46)
11143 + jjCheckNAddTwoStates(30, 38);
11144 + else if (curChar == 36)
11146 + else if (curChar == 39)
11147 + jjCheckNAddTwoStates(25, 26);
11148 + else if (curChar == 61)
11150 + else if (curChar == 33)
11152 + else if (curChar == 47)
11153 + jjstateSet[jjnewStateCnt++] = 3;
11154 + else if (curChar == 45)
11155 + jjstateSet[jjnewStateCnt++] = 0;
11156 + if (curChar == 60)
11158 + else if (curChar == 62)
11162 + if (curChar != 45)
11169 + if ((0xffffffffffffdbffL & l) == 0L)
11176 + if (curChar == 42)
11177 + jjCheckNAddTwoStates(4, 5);
11180 + if ((0xfffffbffffffffffL & l) != 0L)
11181 + jjCheckNAddTwoStates(4, 5);
11184 + if (curChar == 42)
11185 + jjCheckNAddStates(7, 9);
11188 + if ((0xffff7bffffffffffL & l) != 0L)
11189 + jjCheckNAddTwoStates(7, 5);
11192 + if ((0xfffffbffffffffffL & l) != 0L)
11193 + jjCheckNAddTwoStates(7, 5);
11196 + if (curChar == 47 && kind > 6)
11200 + if (curChar == 47)
11201 + jjstateSet[jjnewStateCnt++] = 3;
11204 + if (curChar == 61 && kind > 9)
11208 + if (curChar == 33)
11212 + if (curChar == 62)
11216 + if ((0x5000000000000000L & l) != 0L && kind > 9)
11220 + if (curChar == 60)
11224 + if (curChar == 61)
11228 + if ((0x3ff000000000000L & l) == 0L)
11232 + jjCheckNAddTwoStates(21, 23);
11235 + if (curChar != 58)
11239 + jjCheckNAddTwoStates(21, 23);
11242 + if (curChar == 58)
11243 + jjstateSet[jjnewStateCnt++] = 22;
11246 + if (curChar == 39)
11247 + jjCheckNAddTwoStates(25, 26);
11250 + if ((0xffffff7fffffffffL & l) != 0L)
11251 + jjCheckNAddTwoStates(25, 26);
11254 + if (curChar == 39 && kind > 50)
11258 + if (curChar == 36)
11262 + if ((0x3ff000000000000L & l) == 0L)
11269 + if (curChar == 46)
11270 + jjCheckNAddTwoStates(30, 38);
11273 + if ((0x3ff000000000000L & l) == 0L)
11277 + jjCheckNAddTwoStates(30, 31);
11280 + if ((0x280000000000L & l) != 0L)
11281 + jjCheckNAddTwoStates(33, 36);
11284 + if ((0x3ff000000000000L & l) == 0L)
11288 + jjCheckNAddTwoStates(33, 34);
11291 + if (curChar == 46)
11295 + if ((0x3ff000000000000L & l) == 0L)
11302 + if (curChar == 46)
11306 + if ((0x3ff000000000000L & l) == 0L)
11313 + if ((0x3ff000000000000L & l) == 0L)
11320 + if ((0x3ff000000000000L & l) == 0L)
11324 + jjCheckNAddStates(0, 6);
11327 + if ((0x3ff000000000000L & l) == 0L)
11334 + if ((0x3ff000000000000L & l) == 0L)
11338 + jjCheckNAddStates(10, 12);
11341 + if (curChar == 46)
11345 + if ((0x3ff000000000000L & l) == 0L)
11349 + jjCheckNAddTwoStates(49, 31);
11352 + if ((0x3ff000000000000L & l) == 0L)
11356 + jjCheckNAddTwoStates(50, 51);
11359 + if (curChar == 46)
11363 + if ((0x3ff000000000000L & l) == 0L)
11370 + if ((0x3ff000000000000L & l) == 0L)
11378 + } while(i != startsAt);
11380 + else if (curChar < 128)
11382 + long l = 1L << (curChar & 077);
11385 + switch(jjstateSet[--i])
11388 + if ((0x7fffffe87fffffeL & l) != 0L)
11392 + jjCheckNAddTwoStates(21, 23);
11394 + if ((0x7fffffe07fffffeL & l) != 0L)
11398 + jjCheckNAddStates(13, 15);
11400 + if ((0x2000000020L & l) != 0L)
11404 + if ((0x7fffffe87fffffeL & l) != 0L)
11408 + jjCheckNAddTwoStates(21, 23);
11410 + if ((0x7fffffe07fffffeL & l) != 0L)
11414 + jjCheckNAddStates(13, 15);
11416 + if ((0x2000000020000L & l) != 0L)
11423 + if ((0x7fffffe87fffffeL & l) != 0L)
11427 + jjCheckNAddTwoStates(21, 23);
11429 + if ((0x7fffffe07fffffeL & l) != 0L)
11433 + jjCheckNAddStates(13, 15);
11435 + if ((0x10000000100000L & l) != 0L)
11440 + if ((0x10000000100000L & l) != 0L)
11444 + if ((0x7fffffe87fffffeL & l) != 0L)
11448 + jjCheckNAddTwoStates(21, 23);
11450 + if ((0x7fffffe07fffffeL & l) != 0L)
11454 + jjCheckNAddStates(13, 15);
11456 + if ((0x10000000100000L & l) != 0L)
11461 + if ((0x10000000100000L & l) != 0L)
11465 + if ((0x7fffffe87fffffeL & l) != 0L)
11469 + jjCheckNAddTwoStates(21, 23);
11471 + if ((0x7fffffe07fffffeL & l) != 0L)
11475 + jjCheckNAddStates(13, 15);
11479 + if ((0x7fffffe07fffffeL & l) != 0L)
11483 + jjCheckNAddStates(13, 15);
11485 + if ((0x8000000080L & l) != 0L)
11486 + jjCheckNAddTwoStates(44, 42);
11487 + else if ((0x100000001000L & l) != 0L)
11488 + jjCheckNAddTwoStates(41, 42);
11489 + else if ((0x2000000020L & l) != 0L)
11491 + else if ((0x400000004000L & l) != 0L)
11492 + jjstateSet[jjnewStateCnt++] = 11;
11497 + jjstateSet[jjnewStateCnt++] = 1;
11500 + jjCheckNAddTwoStates(4, 5);
11504 + jjCheckNAddTwoStates(7, 5);
11507 + if ((0x2000000020000L & l) != 0L && kind > 9)
11511 + if ((0x400000004000L & l) != 0L)
11512 + jjstateSet[jjnewStateCnt++] = 11;
11515 + if ((0x2000000020L & l) != 0L)
11519 + if ((0x7fffffe07fffffeL & l) == 0L)
11523 + jjCheckNAddStates(13, 15);
11526 + if ((0x7fffffe87fffffeL & l) == 0L)
11530 + jjCheckNAddTwoStates(21, 23);
11533 + jjAddStates(16, 17);
11536 + if ((0x2000000020L & l) != 0L)
11537 + jjAddStates(18, 20);
11540 + if ((0x100000001000L & l) != 0L)
11541 + jjCheckNAddTwoStates(41, 42);
11544 + if ((0x2000000020L & l) != 0L && kind > 9)
11548 + if ((0x10000000100000L & l) != 0L && kind > 9)
11552 + if ((0x8000000080L & l) != 0L)
11553 + jjCheckNAddTwoStates(44, 42);
11557 + } while(i != startsAt);
11561 + int i2 = (curChar & 0xff) >> 6;
11562 + long l2 = 1L << (curChar & 077);
11565 + switch(jjstateSet[--i])
11568 + if ((jjbitVec0[i2] & l2) == 0L)
11572 + jjstateSet[jjnewStateCnt++] = 1;
11575 + if ((jjbitVec0[i2] & l2) != 0L)
11576 + jjCheckNAddTwoStates(4, 5);
11580 + if ((jjbitVec0[i2] & l2) != 0L)
11581 + jjCheckNAddTwoStates(7, 5);
11584 + if ((jjbitVec0[i2] & l2) != 0L)
11585 + jjAddStates(16, 17);
11589 + } while(i != startsAt);
11591 + if (kind != 0x7fffffff)
11593 + jjmatchedKind = kind;
11594 + jjmatchedPos = curPos;
11595 + kind = 0x7fffffff;
11598 + if ((i = jjnewStateCnt) == (startsAt = 54 - (jjnewStateCnt = startsAt)))
11600 + try { curChar = input_stream.readChar(); }
11601 + catch(java.io.IOException e) { return curPos; }
11604 +static final int[] jjnextStates = {
11605 + 46, 47, 48, 31, 50, 51, 53, 5, 6, 8, 47, 48, 31, 20, 21, 23,
11606 + 25, 26, 32, 33, 36,
11608 +public static final String[] jjstrLiteralImages = {
11609 +"", null, null, null, null, null, null, null, null, null, null, null, null,
11610 +null, null, null, null, null, null, null, null, null, null, null, null, null, null,
11611 +"\52", null, null, null, null, null, null, null, null, null, null, null, null, null,
11612 +null, null, null, null, null, null, null, null, null, null, null, "\75", "\73",
11613 +"\50", "\51", "\54", "\173", "\175", "\53", "\55", "\57", "\56", "\77", "\72",
11614 +"\133", "\135", "\44", };
11615 +public static final String[] lexStateNames = {
11618 +static final long[] jjtoToken = {
11619 + 0xfffec3fffffffe01L, 0xfL,
11621 +static final long[] jjtoSkip = {
11624 +protected SimpleCharStream input_stream;
11625 +private final int[] jjrounds = new int[54];
11626 +private final int[] jjstateSet = new int[108];
11627 +protected char curChar;
11628 +public QueryParserTokenManager(SimpleCharStream stream){
11629 + if (SimpleCharStream.staticFlag)
11630 + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
11631 + input_stream = stream;
11633 +public QueryParserTokenManager(SimpleCharStream stream, int lexState){
11635 + SwitchTo(lexState);
11637 +public void ReInit(SimpleCharStream stream)
11639 + jjmatchedPos = jjnewStateCnt = 0;
11640 + curLexState = defaultLexState;
11641 + input_stream = stream;
11644 +private final void ReInitRounds()
11647 + jjround = 0x80000001;
11648 + for (i = 54; i-- > 0;)
11649 + jjrounds[i] = 0x80000000;
11651 +public void ReInit(SimpleCharStream stream, int lexState)
11654 + SwitchTo(lexState);
11656 +public void SwitchTo(int lexState)
11658 + if (lexState >= 1 || lexState < 0)
11659 + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
11661 + curLexState = lexState;
11664 +protected Token jjFillToken()
11666 + Token t = Token.newToken(jjmatchedKind);
11667 + t.kind = jjmatchedKind;
11668 + String im = jjstrLiteralImages[jjmatchedKind];
11669 + t.image = (im == null) ? input_stream.GetImage() : im;
11670 + t.beginLine = input_stream.getBeginLine();
11671 + t.beginColumn = input_stream.getBeginColumn();
11672 + t.endLine = input_stream.getEndLine();
11673 + t.endColumn = input_stream.getEndColumn();
11677 +int curLexState = 0;
11678 +int defaultLexState = 0;
11679 +int jjnewStateCnt;
11682 +int jjmatchedKind;
11684 +public Token getNextToken()
11687 + Token specialToken = null;
11688 + Token matchedToken;
11696 + curChar = input_stream.BeginToken();
11698 + catch(java.io.IOException e)
11700 + jjmatchedKind = 0;
11701 + matchedToken = jjFillToken();
11702 + return matchedToken;
11705 + try { input_stream.backup(0);
11706 + while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
11707 + curChar = input_stream.BeginToken();
11709 + catch (java.io.IOException e1) { continue EOFLoop; }
11710 + jjmatchedKind = 0x7fffffff;
11711 + jjmatchedPos = 0;
11712 + curPos = jjMoveStringLiteralDfa0_0();
11713 + if (jjmatchedKind != 0x7fffffff)
11715 + if (jjmatchedPos + 1 < curPos)
11716 + input_stream.backup(curPos - jjmatchedPos - 1);
11717 + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
11719 + matchedToken = jjFillToken();
11720 + return matchedToken;
11724 + continue EOFLoop;
11727 + int error_line = input_stream.getEndLine();
11728 + int error_column = input_stream.getEndColumn();
11729 + String error_after = null;
11730 + boolean EOFSeen = false;
11731 + try { input_stream.readChar(); input_stream.backup(1); }
11732 + catch (java.io.IOException e1) {
11734 + error_after = curPos <= 1 ? "" : input_stream.GetImage();
11735 + if (curChar == '\n' || curChar == '\r') {
11737 + error_column = 0;
11743 + input_stream.backup(1);
11744 + error_after = curPos <= 1 ? "" : input_stream.GetImage();
11746 + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
11751 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java
11752 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java 1969-12-31 19:00:00.000000000 -0500
11753 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java 2007-08-31 09:41:35.000000000 -0400
11755 +/* Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java */
11757 +package com.yahoo.pig.impl.logicalLayer.parser;
11759 +public interface QueryParserTreeConstants
11761 + public int JJTPARSE = 0;
11762 + public int JJTEXPR = 1;
11763 + public int JJTNESTEDEXPR = 2;
11764 + public int JJTALIAS = 3;
11765 + public int JJTBASEEXPR = 4;
11766 + public int JJTLOADCLAUSE = 5;
11767 + public int JJTFILTERCLAUSE = 6;
11768 + public int JJTPCOND = 7;
11769 + public int JJTPORCOND = 8;
11770 + public int JJTPANDCOND = 9;
11771 + public int JJTPUNARYCOND = 10;
11772 + public int JJTPNOTCOND = 11;
11773 + public int JJTCOGROUPCLAUSE = 12;
11774 + public int JJTGROUPITEM = 13;
11775 + public int JJTGROUPBYEXPR = 14;
11776 + public int JJTGROUPBYSPEC = 15;
11777 + public int JJTCROSSCLAUSE = 16;
11778 + public int JJTUNIONCLAUSE = 17;
11779 + public int JJTFOREACHCLAUSE = 18;
11780 + public int JJTNESTEDBLOCK = 19;
11781 + public int JJTNESTEDCOMMAND = 20;
11782 + public int JJTNESTEDFILTER = 21;
11783 + public int JJTNESTEDSORTORARRANGE = 22;
11784 + public int JJTNESTEDDISTINCT = 23;
11785 + public int JJTGENERATESTATEMENT = 24;
11786 + public int JJTFLATTENEDGENERATEITEMLIST = 25;
11787 + public int JJTFLATTENEDGENERATEITEM = 26;
11788 + public int JJTGENERATEITEM = 27;
11789 + public int JJTINFIXEXPR = 28;
11790 + public int JJTADDITIVEEXPR = 29;
11791 + public int JJTMULTIPLICATIVEEXPR = 30;
11792 + public int JJTUNARYEXPR = 31;
11793 + public int JJTBASEEVALITEM = 32;
11794 + public int JJTBINCOND = 33;
11795 + public int JJTFUNCEVALITEM = 34;
11796 + public int JJTEVALARGS = 35;
11797 + public int JJTEVALARGSITEM = 36;
11798 + public int JJTASCLAUSE = 37;
11799 + public int JJTSCHEMAELEMENT = 38;
11800 + public int JJTSCHEMAFIELD = 39;
11801 + public int JJTSCHEMATUPLE = 40;
11802 + public int JJTSCHEMABAG = 41;
11803 + public int JJTPEVALSPECPIPE = 42;
11804 + public int JJTPEVALSPEC = 43;
11805 + public int JJTPFILTER = 44;
11806 + public int JJTPSAD = 45;
11807 + public int JJTPEVALITEMLIST = 46;
11808 + public int JJTPEVALITEM = 47;
11809 + public int JJTPNESTABLEEVALITEM = 48;
11810 + public int JJTEVALFUNCTIONITEM = 49;
11811 + public int JJTSERIALIZEDBINCOND = 50;
11812 + public int JJTPSERIALIZEDCOND = 51;
11813 + public int JJTPSERIALIZEDORCOND = 52;
11814 + public int JJTPSERIALIZEDANDCOND = 53;
11815 + public int JJTPSERIALIZEDUNARYCOND = 54;
11816 + public int JJTPSERIALIZEDNOTCOND = 55;
11817 + public int JJTPWINDOW = 56;
11818 + public int JJTPTIMEWINDOW = 57;
11819 + public int JJTPTUPLEWINDOW = 58;
11820 + public int JJTEVALFUNCTION = 59;
11821 + public int JJTGROUPFUNCTION = 60;
11822 + public int JJTLOADFUNCTION = 61;
11823 + public int JJTFILTERFUNCTION = 62;
11824 + public int JJTVOID = 63;
11825 + public int JJTBRACKETEDSIMPLEPROJ = 64;
11826 + public int JJTSIMPLEPROJOREMPTY = 65;
11827 + public int JJTSIMPLEPROJ = 66;
11828 + public int JJTPSIMPLEPROJITEM = 67;
11829 + public int JJTSTAR = 68;
11830 + public int JJTCONST = 69;
11831 + public int JJTPCOLEVALITEM = 70;
11832 + public int JJTDOLLARVAR = 71;
11833 + public int JJTALIASFIELD = 72;
11836 + public String[] jjtNodeName = {
11859 + "NestedSortOrArrange",
11860 + "NestedDistinct",
11861 + "GenerateStatement",
11862 + "FlattenedGenerateItemList",
11863 + "FlattenedGenerateItem",
11867 + "MultiplicativeExpr",
11885 + "PNestableEvalItem",
11886 + "EvalFunctionItem",
11887 + "SerializedBinCond",
11888 + "PSerializedCond",
11889 + "PSerializedOrCond",
11890 + "PSerializedAndCond",
11891 + "PSerializedUnaryCond",
11892 + "PSerializedNotCond",
11899 + "FilterFunction",
11901 + "BracketedSimpleProj",
11902 + "SimpleProjOrEmpty",
11904 + "PSimpleProjItem",
11912 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java
11913 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java 1969-12-31 19:00:00.000000000 -0500
11914 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java 2007-08-31 09:41:35.000000000 -0400
11916 +/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
11917 +package com.yahoo.pig.impl.logicalLayer.parser;
11920 + * An implementation of interface CharStream, where the stream is assumed to
11921 + * contain only ASCII characters (without unicode processing).
11924 +public class SimpleCharStream
11926 + public static final boolean staticFlag = false;
11930 + public int bufpos = -1;
11931 + protected int bufline[];
11932 + protected int bufcolumn[];
11934 + protected int column = 0;
11935 + protected int line = 1;
11937 + protected boolean prevCharIsCR = false;
11938 + protected boolean prevCharIsLF = false;
11940 + protected java.io.Reader inputStream;
11942 + protected char[] buffer;
11943 + protected int maxNextCharInd = 0;
11944 + protected int inBuf = 0;
11945 + protected int tabSize = 8;
11947 + protected void setTabSize(int i) { tabSize = i; }
11948 + protected int getTabSize(int i) { return tabSize; }
11951 + protected void ExpandBuff(boolean wrapAround)
11953 + char[] newbuffer = new char[bufsize + 2048];
11954 + int newbufline[] = new int[bufsize + 2048];
11955 + int newbufcolumn[] = new int[bufsize + 2048];
11961 + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
11962 + System.arraycopy(buffer, 0, newbuffer,
11963 + bufsize - tokenBegin, bufpos);
11964 + buffer = newbuffer;
11966 + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
11967 + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
11968 + bufline = newbufline;
11970 + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
11971 + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
11972 + bufcolumn = newbufcolumn;
11974 + maxNextCharInd = (bufpos += (bufsize - tokenBegin));
11978 + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
11979 + buffer = newbuffer;
11981 + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
11982 + bufline = newbufline;
11984 + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
11985 + bufcolumn = newbufcolumn;
11987 + maxNextCharInd = (bufpos -= tokenBegin);
11990 + catch (Throwable t)
11992 + throw new Error(t.getMessage());
11997 + available = bufsize;
12001 + protected void FillBuff() throws java.io.IOException
12003 + if (maxNextCharInd == available)
12005 + if (available == bufsize)
12007 + if (tokenBegin > 2048)
12009 + bufpos = maxNextCharInd = 0;
12010 + available = tokenBegin;
12012 + else if (tokenBegin < 0)
12013 + bufpos = maxNextCharInd = 0;
12015 + ExpandBuff(false);
12017 + else if (available > tokenBegin)
12018 + available = bufsize;
12019 + else if ((tokenBegin - available) < 2048)
12020 + ExpandBuff(true);
12022 + available = tokenBegin;
12027 + if ((i = inputStream.read(buffer, maxNextCharInd,
12028 + available - maxNextCharInd)) == -1)
12030 + inputStream.close();
12031 + throw new java.io.IOException();
12034 + maxNextCharInd += i;
12037 + catch(java.io.IOException e) {
12040 + if (tokenBegin == -1)
12041 + tokenBegin = bufpos;
12046 + public char BeginToken() throws java.io.IOException
12049 + char c = readChar();
12050 + tokenBegin = bufpos;
12055 + protected void UpdateLineColumn(char c)
12059 + if (prevCharIsLF)
12061 + prevCharIsLF = false;
12062 + line += (column = 1);
12064 + else if (prevCharIsCR)
12066 + prevCharIsCR = false;
12069 + prevCharIsLF = true;
12072 + line += (column = 1);
12078 + prevCharIsCR = true;
12081 + prevCharIsLF = true;
12085 + column += (tabSize - (column % tabSize));
12091 + bufline[bufpos] = line;
12092 + bufcolumn[bufpos] = column;
12095 + public char readChar() throws java.io.IOException
12101 + if (++bufpos == bufsize)
12104 + return buffer[bufpos];
12107 + if (++bufpos >= maxNextCharInd)
12110 + char c = buffer[bufpos];
12112 + UpdateLineColumn(c);
12118 + * @see #getEndColumn
12121 + public int getColumn() {
12122 + return bufcolumn[bufpos];
12127 + * @see #getEndLine
12130 + public int getLine() {
12131 + return bufline[bufpos];
12134 + public int getEndColumn() {
12135 + return bufcolumn[bufpos];
12138 + public int getEndLine() {
12139 + return bufline[bufpos];
12142 + public int getBeginColumn() {
12143 + return bufcolumn[tokenBegin];
12146 + public int getBeginLine() {
12147 + return bufline[tokenBegin];
12150 + public void backup(int amount) {
12153 + if ((bufpos -= amount) < 0)
12154 + bufpos += bufsize;
12157 + public SimpleCharStream(java.io.Reader dstream, int startline,
12158 + int startcolumn, int buffersize)
12160 + inputStream = dstream;
12161 + line = startline;
12162 + column = startcolumn - 1;
12164 + available = bufsize = buffersize;
12165 + buffer = new char[buffersize];
12166 + bufline = new int[buffersize];
12167 + bufcolumn = new int[buffersize];
12170 + public SimpleCharStream(java.io.Reader dstream, int startline,
12173 + this(dstream, startline, startcolumn, 4096);
12176 + public SimpleCharStream(java.io.Reader dstream)
12178 + this(dstream, 1, 1, 4096);
12180 + public void ReInit(java.io.Reader dstream, int startline,
12181 + int startcolumn, int buffersize)
12183 + inputStream = dstream;
12184 + line = startline;
12185 + column = startcolumn - 1;
12187 + if (buffer == null || buffersize != buffer.length)
12189 + available = bufsize = buffersize;
12190 + buffer = new char[buffersize];
12191 + bufline = new int[buffersize];
12192 + bufcolumn = new int[buffersize];
12194 + prevCharIsLF = prevCharIsCR = false;
12195 + tokenBegin = inBuf = maxNextCharInd = 0;
12199 + public void ReInit(java.io.Reader dstream, int startline,
12202 + ReInit(dstream, startline, startcolumn, 4096);
12205 + public void ReInit(java.io.Reader dstream)
12207 + ReInit(dstream, 1, 1, 4096);
12209 + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
12210 + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
12212 + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
12215 + public SimpleCharStream(java.io.InputStream dstream, int startline,
12216 + int startcolumn, int buffersize)
12218 + this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
12221 + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
12222 + int startcolumn) throws java.io.UnsupportedEncodingException
12224 + this(dstream, encoding, startline, startcolumn, 4096);
12227 + public SimpleCharStream(java.io.InputStream dstream, int startline,
12230 + this(dstream, startline, startcolumn, 4096);
12233 + public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
12235 + this(dstream, encoding, 1, 1, 4096);
12238 + public SimpleCharStream(java.io.InputStream dstream)
12240 + this(dstream, 1, 1, 4096);
12243 + public void ReInit(java.io.InputStream dstream, String encoding, int startline,
12244 + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
12246 + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
12249 + public void ReInit(java.io.InputStream dstream, int startline,
12250 + int startcolumn, int buffersize)
12252 + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
12255 + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
12257 + ReInit(dstream, encoding, 1, 1, 4096);
12260 + public void ReInit(java.io.InputStream dstream)
12262 + ReInit(dstream, 1, 1, 4096);
12264 + public void ReInit(java.io.InputStream dstream, String encoding, int startline,
12265 + int startcolumn) throws java.io.UnsupportedEncodingException
12267 + ReInit(dstream, encoding, startline, startcolumn, 4096);
12269 + public void ReInit(java.io.InputStream dstream, int startline,
12272 + ReInit(dstream, startline, startcolumn, 4096);
12274 + public String GetImage()
12276 + if (bufpos >= tokenBegin)
12277 + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
12279 + return new String(buffer, tokenBegin, bufsize - tokenBegin) +
12280 + new String(buffer, 0, bufpos + 1);
12283 + public char[] GetSuffix(int len)
12285 + char[] ret = new char[len];
12287 + if ((bufpos + 1) >= len)
12288 + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
12291 + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
12292 + len - bufpos - 1);
12293 + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
12299 + public void Done()
12303 + bufcolumn = null;
12307 + * Method to adjust line and column numbers for the start of a token.
12309 + public void adjustBeginLineColumn(int newLine, int newCol)
12311 + int start = tokenBegin;
12314 + if (bufpos >= tokenBegin)
12316 + len = bufpos - tokenBegin + inBuf + 1;
12320 + len = bufsize - tokenBegin + bufpos + 1 + inBuf;
12323 + int i = 0, j = 0, k = 0;
12324 + int nextColDiff = 0, columnDiff = 0;
12326 + while (i < len &&
12327 + bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
12329 + bufline[j] = newLine;
12330 + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
12331 + bufcolumn[j] = newCol + columnDiff;
12332 + columnDiff = nextColDiff;
12338 + bufline[j] = newLine++;
12339 + bufcolumn[j] = newCol + columnDiff;
12341 + while (i++ < len)
12343 + if (bufline[j = start % bufsize] != bufline[++start % bufsize])
12344 + bufline[j] = newLine++;
12346 + bufline[j] = newLine;
12350 + line = bufline[j];
12351 + column = bufcolumn[j];
12355 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java
12356 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java 1969-12-31 19:00:00.000000000 -0500
12357 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java 2007-08-31 09:41:35.000000000 -0400
12359 +/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
12361 +package com.yahoo.pig.impl.logicalLayer.parser;
12363 +public class SimpleNode implements Node {
12364 + protected Node parent;
12365 + protected Node[] children;
12366 + protected int id;
12367 + protected QueryParser parser;
12369 + public SimpleNode(int i) {
12373 + public SimpleNode(QueryParser p, int i) {
12378 + public void jjtOpen() {
12381 + public void jjtClose() {
12384 + public void jjtSetParent(Node n) { parent = n; }
12385 + public Node jjtGetParent() { return parent; }
12387 + public void jjtAddChild(Node n, int i) {
12388 + if (children == null) {
12389 + children = new Node[i + 1];
12390 + } else if (i >= children.length) {
12391 + Node c[] = new Node[i + 1];
12392 + System.arraycopy(children, 0, c, 0, children.length);
12398 + public Node jjtGetChild(int i) {
12399 + return children[i];
12402 + public int jjtGetNumChildren() {
12403 + return (children == null) ? 0 : children.length;
12406 + /* You can override these two methods in subclasses of SimpleNode to
12407 + customize the way the node appears when the tree is dumped. If
12408 + your output uses more than one line you should override
12409 + toString(String), otherwise overriding toString() is probably all
12410 + you need to do. */
12412 + public String toString() { return QueryParserTreeConstants.jjtNodeName[id]; }
12413 + public String toString(String prefix) { return prefix + toString(); }
12415 + /* Override this method if you want to customize how the node dumps
12416 + out its children. */
12418 + public void dump(String prefix) {
12419 + System.out.println(toString(prefix));
12420 + if (children != null) {
12421 + for (int i = 0; i < children.length; ++i) {
12422 + SimpleNode n = (SimpleNode)children[i];
12424 + n.dump(prefix + " ");
12431 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java
12432 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java 1969-12-31 19:00:00.000000000 -0500
12433 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java 2007-08-31 09:41:35.000000000 -0400
12435 +/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
12436 +package com.yahoo.pig.impl.logicalLayer.parser;
12439 + * Describes the input token stream.
12442 +public class Token {
12445 + * An integer that describes the kind of this token. This numbering
12446 + * system is determined by JavaCCParser, and a table of these numbers is
12447 + * stored in the file ...Constants.java.
12452 + * beginLine and beginColumn describe the position of the first character
12453 + * of this token; endLine and endColumn describe the position of the
12454 + * last character of this token.
12456 + public int beginLine, beginColumn, endLine, endColumn;
12459 + * The string image of the token.
12461 + public String image;
12464 + * A reference to the next regular (non-special) token from the input
12465 + * stream. If this is the last token from the input stream, or if the
12466 + * token manager has not read tokens beyond this one, this field is
12467 + * set to null. This is true only if this token is also a regular
12468 + * token. Otherwise, see below for a description of the contents of
12471 + public Token next;
12474 + * This field is used to access special tokens that occur prior to this
12475 + * token, but after the immediately preceding regular (non-special) token.
12476 + * If there are no such special tokens, this field is set to null.
12477 + * When there are more than one such special token, this field refers
12478 + * to the last of these special tokens, which in turn refers to the next
12479 + * previous special token through its specialToken field, and so on
12480 + * until the first special token (whose specialToken field is null).
12481 + * The next fields of special tokens refer to other special tokens that
12482 + * immediately follow it (without an intervening regular token). If there
12483 + * is no such token, this field is null.
12485 + public Token specialToken;
12488 + * Returns the image.
12490 + public String toString()
12496 + * Returns a new Token object, by default. However, if you want, you
12497 + * can create and return subclass objects based on the value of ofKind.
12498 + * Simply add the cases to the switch for all those special cases.
12499 + * For example, if you have a subclass of Token called IDToken that
12500 + * you want to create if ofKind is ID, simlpy add something like :
12502 + * case MyParserConstants.ID : return new IDToken();
12504 + * to the following switch statement. Then you can cast matchedToken
12505 + * variable to the appropriate type and use it in your lexical actions.
12507 + public static final Token newToken(int ofKind)
12511 + default : return new Token();
12516 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java
12517 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java 1969-12-31 19:00:00.000000000 -0500
12518 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java 2007-08-31 09:41:35.000000000 -0400
12520 +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
12521 +package com.yahoo.pig.impl.logicalLayer.parser;
12523 +public class TokenMgrError extends Error
12526 + * Ordinals for various reasons why an Error of this type can be thrown.
12530 + * Lexical error occured.
12532 + static final int LEXICAL_ERROR = 0;
12535 + * An attempt wass made to create a second instance of a static token manager.
12537 + static final int STATIC_LEXER_ERROR = 1;
12540 + * Tried to change to an invalid lexical state.
12542 + static final int INVALID_LEXICAL_STATE = 2;
12545 + * Detected (and bailed out of) an infinite loop in the token manager.
12547 + static final int LOOP_DETECTED = 3;
12550 + * Indicates the reason why the exception is thrown. It will have
12551 + * one of the above 4 values.
12556 + * Replaces unprintable characters by their espaced (or unicode escaped)
12557 + * equivalents in the given string
12559 + protected static final String addEscapes(String str) {
12560 + StringBuffer retval = new StringBuffer();
12562 + for (int i = 0; i < str.length(); i++) {
12563 + switch (str.charAt(i))
12568 + retval.append("\\b");
12571 + retval.append("\\t");
12574 + retval.append("\\n");
12577 + retval.append("\\f");
12580 + retval.append("\\r");
12583 + retval.append("\\\"");
12586 + retval.append("\\\'");
12589 + retval.append("\\\\");
12592 + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
12593 + String s = "0000" + Integer.toString(ch, 16);
12594 + retval.append("\\u" + s.substring(s.length() - 4, s.length()));
12596 + retval.append(ch);
12601 + return retval.toString();
12605 + * Returns a detailed message for the Error when it is thrown by the
12606 + * token manager to indicate a lexical error.
12608 + * EOFSeen : indicates if EOF caused the lexicl error
12609 + * curLexState : lexical state in which this error occured
12610 + * errorLine : line number when the error occured
12611 + * errorColumn : column number when the error occured
12612 + * errorAfter : prefix that was seen before this error occured
12613 + * curchar : the offending character
12614 + * Note: You can customize the lexical error message by modifying this method.
12616 + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
12617 + return("Lexical error at line " +
12618 + errorLine + ", column " +
12619 + errorColumn + ". Encountered: " +
12620 + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
12621 + "after : \"" + addEscapes(errorAfter) + "\"");
12625 + * You can also modify the body of this method to customize your error messages.
12626 + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
12627 + * of end-users concern, so you can return something like :
12629 + * "Internal Error : Please file a bug report .... "
12631 + * from this method for such cases in the release version of your parser.
12633 + public String getMessage() {
12634 + return super.getMessage();
12638 + * Constructors of various flavors follow.
12641 + public TokenMgrError() {
12644 + public TokenMgrError(String message, int reason) {
12646 + errorCode = reason;
12649 + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
12650 + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
12653 diff -Naur pig-original/src/com/yahoo/pig/impl/mapreduceExec/BZip.java pig-galago/src/com/yahoo/pig/impl/mapreduceExec/BZip.java
12654 --- pig-original/src/com/yahoo/pig/impl/mapreduceExec/BZip.java 2007-04-05 11:24:35.000000000 -0400
12655 +++ pig-galago/src/com/yahoo/pig/impl/mapreduceExec/BZip.java 2007-08-31 09:55:16.000000000 -0400
12657 import org.apache.hadoop.io.compress.CompressionCodec;
12658 import org.apache.hadoop.io.compress.CompressionInputStream;
12659 import org.apache.hadoop.io.compress.CompressionOutputStream;
12660 +import org.apache.hadoop.io.compress.Compressor;
12661 +import org.apache.hadoop.io.compress.Decompressor;
12662 import org.apache.tools.bzip2.CBZip2InputStream;
12663 import org.apache.tools.bzip2.CBZip2OutputStream;
12666 public String getDefaultExtension() {
12670 + public CompressionOutputStream createOutputStream(OutputStream outputStream, Compressor compressor) throws IOException {
12674 + public Class getCompressorType() {
12678 + public Compressor createCompressor() {
12682 + public CompressionInputStream createInputStream(InputStream inputStream, Decompressor decompressor) throws IOException {
12686 + public Class getDecompressorType() {
12690 + public Decompressor createDecompressor() {
12694 diff -Naur pig-original/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java pig-galago/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java
12695 --- pig-original/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java 2007-04-05 11:40:32.000000000 -0400
12696 +++ pig-galago/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java 2007-08-31 09:54:42.000000000 -0400
12698 import org.apache.hadoop.mapred.JobSubmissionProtocol;
12699 import org.apache.hadoop.mapred.JobTracker;
12700 import org.apache.hadoop.mapred.TaskReport;
12701 -import org.apache.hadoop.util.HadoopExe;
12703 import com.yahoo.pig.PigServer;
12704 import com.yahoo.pig.builtin.PigStorage;
12705 @@ -547,10 +546,6 @@
12709 - } else if (args[jarIndex].equals("-H")) {
12710 - String newArgs[] = new String[args.length - jarIndex-1];
12711 - System.arraycopy(args, jarIndex+1, newArgs, 0, newArgs.length);
12712 - invokeMain(HadoopExe.class, args);
12714 JarFile jar = new JarFile(args[jarIndex]);
12716 diff -Naur pig-original/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java pig-galago/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java
12717 --- pig-original/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java 2007-04-05 11:24:35.000000000 -0400
12718 +++ pig-galago/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java 2007-09-04 10:39:26.000000000 -0400
12719 @@ -132,6 +132,10 @@
12720 public boolean compiled() {
12724 + public void setCompiled( boolean compiled ) {
12725 + this.compiled = compiled;
12728 public boolean executed() {
12730 diff -Naur pig-original/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java pig-galago/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java
12731 --- pig-original/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java 2007-04-05 11:24:35.000000000 -0400
12732 +++ pig-galago/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java 2007-09-03 13:15:06.000000000 -0400
12735 package com.yahoo.pig.impl.physicalLayer;
12737 +import com.yahoo.pig.impl.galago.GalagoPlanCompiler;
12738 import java.io.IOException;
12739 import java.util.Map;
12743 root = (new MapreducePlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12746 + root = (new GalagoPlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12749 root = (new PigbodyPlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12751 diff -Naur pig-original/src/com/yahoo/pig/tools/grunt/Grunt.java pig-galago/src/com/yahoo/pig/tools/grunt/Grunt.java
12752 --- pig-original/src/com/yahoo/pig/tools/grunt/Grunt.java 2007-04-05 11:24:35.000000000 -0400
12753 +++ pig-galago/src/com/yahoo/pig/tools/grunt/Grunt.java 2007-09-01 16:22:28.000000000 -0400
12755 import com.yahoo.pig.data.Tuple;
12756 import com.yahoo.pig.impl.logicalLayer.parser.ParseException;
12757 import com.yahoo.pig.impl.logicalLayer.parser.TokenMgrError;
12758 +import java.io.InputStreamReader;
12760 public class Grunt {
12765 this.jobTracker = jobTracker;
12766 - this.pig = new PigServer(ExecType.MAPREDUCE);
12767 + this.pig = new PigServer(ExecType.LOCAL);
12770 + public static void main( String[] args ) {
12771 + Grunt g = new Grunt( new BufferedReader( new InputStreamReader( System.in ) ), null, null, null, null );
12775 public void run() {