1 /* Generated By:JJTree&JavaCC: Do not edit this line. QueryParser.java */
2 package com
.yahoo
.pig
.impl
.logicalLayer
.parser
;
5 import java
.lang
.reflect
.*;
6 import com
.yahoo
.pig
.impl
.logicalLayer
.*;
7 import com
.yahoo
.pig
.impl
.eval
.*;
8 import com
.yahoo
.pig
.impl
.eval
.func
.*;
9 import com
.yahoo
.pig
.impl
.eval
.groupby
.*;
10 import com
.yahoo
.pig
.impl
.eval
.filter
.*;
11 import com
.yahoo
.pig
.impl
.eval
.window
.*;
12 import com
.yahoo
.pig
.impl
.eval
.sad
.*;
13 import com
.yahoo
.pig
.impl
.logicalLayer
.schema
.*;
14 import com
.yahoo
.pig
.*;
15 import com
.yahoo
.pig
.impl
.PigContext
;
16 import com
.yahoo
.pig
.PigServer
.ExecType
;
17 import com
.yahoo
.pig
.impl
.physicalLayer
.IntermedResult
;
18 import com
.yahoo
.pig
.impl
.io
.FileLocalizer
;
19 import com
.yahoo
.pig
.builtin
.*;
20 public class QueryParser
/*@bgen(jjtree)*/implements QueryParserTreeConstants
, QueryParserConstants
{/*@bgen(jjtree)*/
21 protected JJTQueryParserState jjtree
= new JJTQueryParserState();private PigContext pigContext
;
22 private Map
<String
, IntermedResult
> aliases
;
24 public QueryParser(InputStream in
, PigContext pigContext
, Map aliases
) {
26 this.pigContext
= pigContext
;
27 this.aliases
= aliases
;
30 public class EvalSpecPipeAndSchema
{
32 SchemaItemList schema
;
35 public class CogroupInput
{
36 public LogicalOperator op
;
37 public GroupBySpec spec
;
40 static String
unquote(String s
) {
41 return s
.substring(1, s
.length()-1);
44 static int undollar(String s
) {
45 return Integer
.parseInt(s
.substring(1, s
.length()));
48 NestableEvalItem
newFuncEvalItem(EvalFunc func
, EvalItemList args
) throws ParseException
{
49 if (func
instanceof AtomEvalFunc
) return new AtomFuncEvalItem(pigContext
, (AtomEvalFunc
) func
, args
);
50 else if (func
instanceof TupleEvalFunc
) return new TupleFuncEvalItem(pigContext
, (TupleEvalFunc
) func
, args
);
51 else if (func
instanceof BagEvalFunc
) return new BagFuncEvalItem(pigContext
, (BagEvalFunc
) func
, args
);
52 else throw new ParseException("Error: unknown Eval Function type: " + func
.getClass().getName());
56 LogicalOperator
makeLORead(String alias
) throws ParseException
{
57 if (!aliases
.containsKey(alias
)) throw new ParseException("Unrecognized alias: " + alias
);
59 LORead readOp
= new LORead(pigContext
, aliases
.get(alias
));
66 String
massageFilename(String filename
) throws IOException
{
67 if (pigContext
.getExecType() != ExecType
.LOCAL
) {
68 if (filename
.startsWith(FileLocalizer
.LOCAL_PREFIX
)) {
69 filename
= FileLocalizer
.hadoopify(filename
);
71 if (filename
.startsWith(FileLocalizer
.HADOOP_PREFIX
)) {
72 filename
= filename
.substring(FileLocalizer
.HADOOP_PREFIX
.length());
80 LogicalOperator
parseCogroup(ArrayList
<CogroupInput
> gis
) throws ParseException
{
83 LogicalOperator
[] los
= new LogicalOperator
[n
];
84 GroupBySpec
[] specs
= new GroupBySpec
[n
];
86 for (int i
= 0; i
< n
; i
++){
88 CogroupInput gi
= gis
.get(i
);
93 return new LOCogroup(pigContext
, los
, specs
);
97 LogicalOperator
rewriteCross(ArrayList
<LogicalOperator
> inputs
) throws IOException
, ParseException
{
98 ArrayList
<CogroupInput
> gis
= new ArrayList
<CogroupInput
>();
99 Iterator
<LogicalOperator
> iter
= inputs
.iterator();
100 int n
= inputs
.size();
102 EvalSpecPipe pipe
= new EvalSpecPipe(pigContext
);
103 EvalItemList list
= new EvalItemList(pigContext
);
105 for (int i
=0; i
< n
; i
++){
107 CogroupInput gi
= new CogroupInput();
110 gi
.op
= inputs
.get(i
);
111 EvalItemList itemList
= new EvalItemList(pigContext
);
112 itemList
.add(new ConstEvalItem(pigContext
, n
+""));
113 itemList
.add(new ConstEvalItem(pigContext
, i
+""));
114 gi
.spec
= new GroupBySpec(pigContext
, (GroupFunc
) pigContext
.getUDF(GFCross
.class.getName()), itemList
, false);
116 ColEvalItem item
= new ColEvalItem(pigContext
, i
+1);
117 EvalItemList subSpec
= new EvalItemList(pigContext
);
118 subSpec
.add(new StarEvalItem(pigContext
));
119 item
.subColSpec
= subSpec
;
124 return new LOEval(pigContext
, parseCogroup(gis
),pipe
);
127 LOLoad
getDefaultLoadOperator(boolean continuous
, String filename
) throws IOException
{
129 String
[] args
= null;
132 args = new String[2];
137 StorageFunc loadFunc
= (StorageFunc
) pigContext
.getUDF(PigStorage
.class.getName());
138 return new LOLoad(pigContext
, massageFilename(filename
), loadFunc
, args
);
141 void assertAtomic(EvalItem item
, boolean desiredAtomic
) throws ParseException
{
142 Boolean isAtomic
= null;
143 if (item
instanceof ConstEvalItem
|| item
instanceof AtomFuncEvalItem
)
145 else if (item
instanceof FuncEvalItem
)
148 if (isAtomic
!= null && isAtomic
!= desiredAtomic
){
150 throw new ParseException("Atomic field expected but found non-atomic field");
152 throw new ParseException("Non-atomic field expected but found atomic field");
156 EvalItem
copyItemAndAddSpec(EvalItem item
, EvalSpec spec
) throws ParseException
{
157 assertAtomic(item
,false);
159 if (!(item
instanceof NestableEvalItem
))
160 throw new ParseException("Internal Error: Cannot add spec to non-nestable field.");
161 NestableEvalItem nestableItem
= (NestableEvalItem
)item
;
162 EvalSpecPipe specPipe
= nestableItem
.nestedEval
;
163 nestableItem
.addNestedEvalSpec(spec
);
167 // Parse is the Starting function.
168 final public LogicalPlan
Parse() throws ParseException
{
169 /*@bgen(jjtree) Parse */
170 SimpleNode jjtn000
= new SimpleNode(JJTPARSE
);
171 boolean jjtc000
= true;
172 jjtree
.openNodeScope(jjtn000
);LogicalOperator root
; Token t1
;
175 t1
= jj_consume_token(IDENTIFIER
);
176 jj_consume_token(52);
178 jj_consume_token(53);
179 root
.alias
= t1
.image
;
181 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
192 jj_consume_token(53);
196 jj_consume_token(-1);
197 throw new ParseException();
200 jjtree
.closeNodeScope(jjtn000
, true);
202 {if (true) return new LogicalPlan(root
, pigContext
);}
203 } catch (Throwable jjte000
) {
205 jjtree
.clearNodeScope(jjtn000
);
210 if (jjte000
instanceof RuntimeException
) {
211 {if (true) throw (RuntimeException
)jjte000
;}
213 if (jjte000
instanceof ParseException
) {
214 {if (true) throw (ParseException
)jjte000
;}
216 {if (true) throw (Error
)jjte000
;}
219 jjtree
.closeNodeScope(jjtn000
, true);
222 throw new Error("Missing return statement in function");
225 final public LogicalOperator
Expr() throws ParseException
{
226 /*@bgen(jjtree) Expr */
227 SimpleNode jjtn000
= new SimpleNode(JJTEXPR
);
228 boolean jjtc000
= true;
229 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
; SchemaItemList schema
;
231 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
235 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
237 jj_consume_token(AS
);
257 jj_consume_token(-1);
258 throw new ParseException();
260 jjtree
.closeNodeScope(jjtn000
, true);
262 {if (true) return op
;}
263 } catch (Throwable jjte000
) {
265 jjtree
.clearNodeScope(jjtn000
);
270 if (jjte000
instanceof RuntimeException
) {
271 {if (true) throw (RuntimeException
)jjte000
;}
273 if (jjte000
instanceof ParseException
) {
274 {if (true) throw (ParseException
)jjte000
;}
276 {if (true) throw (Error
)jjte000
;}
279 jjtree
.closeNodeScope(jjtn000
, true);
282 throw new Error("Missing return statement in function");
285 final public LogicalOperator
NestedExpr() throws ParseException
{
286 /*@bgen(jjtree) NestedExpr */
287 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDEXPR
);
288 boolean jjtc000
= true;
289 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
;
291 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
298 jj_consume_token(54);
300 jj_consume_token(55);
302 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
304 jj_consume_token(54);
306 jj_consume_token(55);
310 jj_consume_token(-1);
311 throw new ParseException();
315 jjtree
.closeNodeScope(jjtn000
, true);
317 {if (true) return op
;}
318 } catch (Throwable jjte000
) {
320 jjtree
.clearNodeScope(jjtn000
);
325 if (jjte000
instanceof RuntimeException
) {
326 {if (true) throw (RuntimeException
)jjte000
;}
328 if (jjte000
instanceof ParseException
) {
329 {if (true) throw (ParseException
)jjte000
;}
331 {if (true) throw (Error
)jjte000
;}
334 jjtree
.closeNodeScope(jjtn000
, true);
337 throw new Error("Missing return statement in function");
340 // A reference to an alias
341 final public LogicalOperator
Alias() throws ParseException
{
342 /*@bgen(jjtree) Alias */
343 SimpleNode jjtn000
= new SimpleNode(JJTALIAS
);
344 boolean jjtc000
= true;
345 jjtree
.openNodeScope(jjtn000
);Token t1
; LogicalOperator op
;
347 t1
= jj_consume_token(IDENTIFIER
);
348 jjtree
.closeNodeScope(jjtn000
, true);
350 op
= makeLORead(t1
.image
);
351 {if (true) return op
;}
354 jjtree
.closeNodeScope(jjtn000
, true);
357 throw new Error("Missing return statement in function");
360 final public LogicalOperator
BaseExpr() throws ParseException
{
361 /*@bgen(jjtree) BaseExpr */
362 SimpleNode jjtn000
= new SimpleNode(JJTBASEEXPR
);
363 boolean jjtc000
= true;
364 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
; SchemaItemList schema
; Token t1
, t2
;
366 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
368 jj_consume_token(LOAD
);
370 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
372 jj_consume_token(AS
);
383 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
385 jj_consume_token(GROUP
);
388 jj_consume_token(COGROUP
);
392 jj_consume_token(-1);
393 throw new ParseException();
395 op
= CogroupClause();
398 jj_consume_token(FILTER
);
402 jj_consume_token(CROSS
);
406 jj_consume_token(UNION
);
410 jj_consume_token(FOREACH
);
411 op
= ForEachClause();
415 jj_consume_token(-1);
416 throw new ParseException();
418 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
420 jj_consume_token(PARALLEL
);
421 t2
= jj_consume_token(NUMBER
);
422 op
.requestedParallelism
= Integer
.parseInt(t2
.image
);
428 jjtree
.closeNodeScope(jjtn000
, true);
430 {if (true) return op
;}
431 } catch (Throwable jjte000
) {
433 jjtree
.clearNodeScope(jjtn000
);
438 if (jjte000
instanceof RuntimeException
) {
439 {if (true) throw (RuntimeException
)jjte000
;}
441 if (jjte000
instanceof ParseException
) {
442 {if (true) throw (ParseException
)jjte000
;}
444 {if (true) throw (Error
)jjte000
;}
447 jjtree
.closeNodeScope(jjtn000
, true);
450 throw new Error("Missing return statement in function");
453 final public LogicalOperator
LoadClause() throws ParseException
{
454 /*@bgen(jjtree) LoadClause */
455 SimpleNode jjtn000
= new SimpleNode(JJTLOADCLAUSE
);
456 boolean jjtc000
= true;
457 jjtree
.openNodeScope(jjtn000
);Token t1
, t2
; String filename
; StorageFunc loadFunc
= null;
458 ArrayList
<String
> loadParams
= new ArrayList
<String
>(); LOLoad lo
=null; boolean continuous
=false;
460 t1
= jj_consume_token(QUOTEDSTRING
);
461 filename
= unquote(t1
.image
);
462 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
464 jj_consume_token(USING
);
465 loadFunc
= LoadFunction();
466 jj_consume_token(54);
467 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
469 t2
= jj_consume_token(QUOTEDSTRING
);
470 loadParams
.add(t2
.image
);
478 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
486 jj_consume_token(56);
487 t2
= jj_consume_token(QUOTEDSTRING
);
488 loadParams
.add(t2
.image
);
490 jj_consume_token(55);
491 lo
= new LOLoad(pigContext
, massageFilename(filename
), loadFunc
, loadParams
);
497 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
499 jj_consume_token(CONTINUOUSLY
);
506 jjtree
.closeNodeScope(jjtn000
, true);
509 lo
= getDefaultLoadOperator(continuous
,filename
);
512 lo
.setOutputType(LogicalOperator
.MONOTONE
);
513 {if (true) return lo
;}
514 } catch (Throwable jjte000
) {
516 jjtree
.clearNodeScope(jjtn000
);
521 if (jjte000
instanceof RuntimeException
) {
522 {if (true) throw (RuntimeException
)jjte000
;}
524 if (jjte000
instanceof ParseException
) {
525 {if (true) throw (ParseException
)jjte000
;}
527 {if (true) throw (Error
)jjte000
;}
530 jjtree
.closeNodeScope(jjtn000
, true);
533 throw new Error("Missing return statement in function");
536 final public LogicalOperator
FilterClause() throws ParseException
{
537 /*@bgen(jjtree) FilterClause */
538 SimpleNode jjtn000
= new SimpleNode(JJTFILTERCLAUSE
);
539 boolean jjtc000
= true;
540 jjtree
.openNodeScope(jjtn000
);Cond cond
; LogicalOperator input
;
542 input
= NestedExpr();
543 jj_consume_token(BY
);
544 cond
= PCond(input
.outputSchema(),null);
545 jjtree
.closeNodeScope(jjtn000
, true);
547 EvalSpecPipe specPipe
= new EvalSpecPipe(pigContext
);
548 specPipe
.add(new FilterSpec(cond
));
549 {if (true) return new LOEval(pigContext
, input
, specPipe
);}
550 } catch (Throwable jjte000
) {
552 jjtree
.clearNodeScope(jjtn000
);
557 if (jjte000
instanceof RuntimeException
) {
558 {if (true) throw (RuntimeException
)jjte000
;}
560 if (jjte000
instanceof ParseException
) {
561 {if (true) throw (ParseException
)jjte000
;}
563 {if (true) throw (Error
)jjte000
;}
566 jjtree
.closeNodeScope(jjtn000
, true);
569 throw new Error("Missing return statement in function");
572 final public Cond
PCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
573 /*@bgen(jjtree) PCond */
574 SimpleNode jjtn000
= new SimpleNode(JJTPCOND
);
575 boolean jjtc000
= true;
576 jjtree
.openNodeScope(jjtn000
);Cond cond
= null;
578 cond
= POrCond(over
,pipes
);
579 jjtree
.closeNodeScope(jjtn000
, true);
581 {if (true) return cond
;}
582 } catch (Throwable jjte000
) {
584 jjtree
.clearNodeScope(jjtn000
);
589 if (jjte000
instanceof RuntimeException
) {
590 {if (true) throw (RuntimeException
)jjte000
;}
592 if (jjte000
instanceof ParseException
) {
593 {if (true) throw (ParseException
)jjte000
;}
595 {if (true) throw (Error
)jjte000
;}
598 jjtree
.closeNodeScope(jjtn000
, true);
601 throw new Error("Missing return statement in function");
604 final public Cond
POrCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
605 /*@bgen(jjtree) POrCond */
606 SimpleNode jjtn000
= new SimpleNode(JJTPORCOND
);
607 boolean jjtc000
= true;
608 jjtree
.openNodeScope(jjtn000
);Cond cond
; List
<Cond
> cList
= new ArrayList
<Cond
>();
610 cond
= PAndCond(over
,pipes
);
614 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
622 jj_consume_token(OR
);
623 cond
= PAndCond(over
,pipes
);
626 jjtree
.closeNodeScope(jjtn000
, true);
629 {if (true) return cond
;}
631 {if (true) return new OrCond(cList
);}
632 } catch (Throwable jjte000
) {
634 jjtree
.clearNodeScope(jjtn000
);
639 if (jjte000
instanceof RuntimeException
) {
640 {if (true) throw (RuntimeException
)jjte000
;}
642 if (jjte000
instanceof ParseException
) {
643 {if (true) throw (ParseException
)jjte000
;}
645 {if (true) throw (Error
)jjte000
;}
648 jjtree
.closeNodeScope(jjtn000
, true);
651 throw new Error("Missing return statement in function");
654 final public Cond
PAndCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
655 /*@bgen(jjtree) PAndCond */
656 SimpleNode jjtn000
= new SimpleNode(JJTPANDCOND
);
657 boolean jjtc000
= true;
658 jjtree
.openNodeScope(jjtn000
);Cond cond
= null; List
<Cond
> cList
= new ArrayList
<Cond
>();
660 cond
= PUnaryCond(over
,pipes
);
664 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
672 jj_consume_token(AND
);
673 cond
= PUnaryCond(over
,pipes
);
676 jjtree
.closeNodeScope(jjtn000
, true);
679 {if (true) return cond
;}
681 {if (true) return new AndCond(cList
);}
682 } catch (Throwable jjte000
) {
684 jjtree
.clearNodeScope(jjtn000
);
689 if (jjte000
instanceof RuntimeException
) {
690 {if (true) throw (RuntimeException
)jjte000
;}
692 if (jjte000
instanceof ParseException
) {
693 {if (true) throw (ParseException
)jjte000
;}
695 {if (true) throw (Error
)jjte000
;}
698 jjtree
.closeNodeScope(jjtn000
, true);
701 throw new Error("Missing return statement in function");
704 final public Cond
PUnaryCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
705 /*@bgen(jjtree) PUnaryCond */
706 SimpleNode jjtn000
= new SimpleNode(JJTPUNARYCOND
);
707 boolean jjtc000
= true;
708 jjtree
.openNodeScope(jjtn000
);Cond cond
= null; EvalItem c1
, c2
; Token t1
; FilterFunc func
; EvalItemList args
;
710 if (jj_2_3(2147483647)) {
711 jj_consume_token(54);
712 cond
= PCond(over
,pipes
);
713 jj_consume_token(55);
714 } else if (jj_2_4(2147483647)) {
715 func
= FilterFunction();
716 jj_consume_token(54);
717 args
= EvalArgs(over
,pipes
);
718 jj_consume_token(55);
719 cond
= new FuncCond(func
, args
);
721 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
723 cond
= PNotCond(over
,pipes
);
727 if (jj_2_5(2147483647)) {
728 c1
= InfixExpr(over
,pipes
);
729 t1
= jj_consume_token(FILTEROP
);
730 c2
= InfixExpr(over
,pipes
);
731 cond
= new CompCond(c1
, t1
.image
, c2
);
732 } else if (jj_2_6(2)) {
733 c1
= InfixExpr(over
,pipes
);
734 jj_consume_token(MATCHES
);
735 t1
= jj_consume_token(QUOTEDSTRING
);
736 cond
= new RegexpCond(c1
, unquote(t1
.image
));
738 jj_consume_token(-1);
739 throw new ParseException();
743 jjtree
.closeNodeScope(jjtn000
, true);
745 {if (true) return cond
;}
746 } catch (Throwable jjte000
) {
748 jjtree
.clearNodeScope(jjtn000
);
753 if (jjte000
instanceof RuntimeException
) {
754 {if (true) throw (RuntimeException
)jjte000
;}
756 if (jjte000
instanceof ParseException
) {
757 {if (true) throw (ParseException
)jjte000
;}
759 {if (true) throw (Error
)jjte000
;}
762 jjtree
.closeNodeScope(jjtn000
, true);
765 throw new Error("Missing return statement in function");
768 final public Cond
PNotCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
769 /*@bgen(jjtree) PNotCond */
770 SimpleNode jjtn000
= new SimpleNode(JJTPNOTCOND
);
771 boolean jjtc000
= true;
772 jjtree
.openNodeScope(jjtn000
);Cond c1
;
774 jj_consume_token(NOT
);
775 c1
= PUnaryCond(over
,pipes
);
776 jjtree
.closeNodeScope(jjtn000
, true);
778 {if (true) return new NotCond(c1
);}
779 } catch (Throwable jjte000
) {
781 jjtree
.clearNodeScope(jjtn000
);
786 if (jjte000
instanceof RuntimeException
) {
787 {if (true) throw (RuntimeException
)jjte000
;}
789 if (jjte000
instanceof ParseException
) {
790 {if (true) throw (ParseException
)jjte000
;}
792 {if (true) throw (Error
)jjte000
;}
795 jjtree
.closeNodeScope(jjtn000
, true);
798 throw new Error("Missing return statement in function");
801 final public LogicalOperator
CogroupClause() throws ParseException
{
802 /*@bgen(jjtree) CogroupClause */
803 SimpleNode jjtn000
= new SimpleNode(JJTCOGROUPCLAUSE
);
804 boolean jjtc000
= true;
805 jjtree
.openNodeScope(jjtn000
);CogroupInput gi
; ArrayList
<CogroupInput
> gis
= new ArrayList
<CogroupInput
>();
811 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
819 jj_consume_token(56);
823 jjtree
.closeNodeScope(jjtn000
, true);
825 {if (true) return parseCogroup(gis
);}
826 } catch (Throwable jjte000
) {
828 jjtree
.clearNodeScope(jjtn000
);
833 if (jjte000
instanceof RuntimeException
) {
834 {if (true) throw (RuntimeException
)jjte000
;}
836 if (jjte000
instanceof ParseException
) {
837 {if (true) throw (ParseException
)jjte000
;}
839 {if (true) throw (Error
)jjte000
;}
842 jjtree
.closeNodeScope(jjtn000
, true);
845 throw new Error("Missing return statement in function");
848 final public CogroupInput
GroupItem() throws ParseException
{
849 /*@bgen(jjtree) GroupItem */
850 SimpleNode jjtn000
= new SimpleNode(JJTGROUPITEM
);
851 boolean jjtc000
= true;
852 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
; GroupFunc groupFunc
; CogroupInput cogroupInput
= new CogroupInput();
854 cogroupInput
.op
= NestedExpr();
855 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
857 jj_consume_token(BY
);
858 cogroupInput
.spec
= GroupByExpr(cogroupInput
.op
.outputSchema());
861 jj_consume_token(ALL
);
862 cogroupInput
.spec
= new GroupBySpec(pigContext
, (GroupFunc
) pigContext
.getUDF(GFAll
.class.getName()), new EvalItemList(pigContext
), false);
865 jj_consume_token(ANY
);
866 cogroupInput
.spec
= new GroupBySpec(pigContext
, (GroupFunc
) pigContext
.getUDF(GFAny
.class.getName()), new EvalItemList(pigContext
), false);
870 jj_consume_token(-1);
871 throw new ParseException();
873 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
876 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
878 jj_consume_token(INNER
);
879 cogroupInput
.spec
.isInner
= true;
882 jj_consume_token(OUTER
);
886 jj_consume_token(-1);
887 throw new ParseException();
894 jjtree
.closeNodeScope(jjtn000
, true);
896 {if (true) return cogroupInput
;}
897 } catch (Throwable jjte000
) {
899 jjtree
.clearNodeScope(jjtn000
);
904 if (jjte000
instanceof RuntimeException
) {
905 {if (true) throw (RuntimeException
)jjte000
;}
907 if (jjte000
instanceof ParseException
) {
908 {if (true) throw (ParseException
)jjte000
;}
910 {if (true) throw (Error
)jjte000
;}
913 jjtree
.closeNodeScope(jjtn000
, true);
916 throw new Error("Missing return statement in function");
919 final public GroupBySpec
GroupByExpr(SchemaItem over
) throws ParseException
{
920 /*@bgen(jjtree) GroupByExpr */
921 SimpleNode jjtn000
= new SimpleNode(JJTGROUPBYEXPR
);
922 boolean jjtc000
= true;
923 jjtree
.openNodeScope(jjtn000
);Token t1
; GroupBySpec spec
= null; EvalItem projItem
= null; EvalItemList proj
= null; String s
; GroupFunc func
= null;
926 func
= GroupFunction();
927 jj_consume_token(54);
928 proj
= SimpleProjOrEmpty(over
);
929 jj_consume_token(55);
930 spec
= new GroupBySpec(pigContext
, func
, proj
, false);
932 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
939 proj
= BracketedSimpleProj(over
);
940 spec
= new GroupBySpec(pigContext
, (GroupFunc
) pigContext
.getUDF(GFTupleNoop
.class.getName()), proj
, false);
944 jj_consume_token(-1);
945 throw new ParseException();
948 jjtree
.closeNodeScope(jjtn000
, true);
950 {if (true) return spec
;}
951 } catch (Throwable jjte000
) {
953 jjtree
.clearNodeScope(jjtn000
);
958 if (jjte000
instanceof RuntimeException
) {
959 {if (true) throw (RuntimeException
)jjte000
;}
961 if (jjte000
instanceof ParseException
) {
962 {if (true) throw (ParseException
)jjte000
;}
964 {if (true) throw (Error
)jjte000
;}
967 jjtree
.closeNodeScope(jjtn000
, true);
970 throw new Error("Missing return statement in function");
973 //Used in serialization and deserialization
974 final public GroupBySpec
GroupBySpec() throws ParseException
{
975 /*@bgen(jjtree) GroupBySpec */
976 SimpleNode jjtn000
= new SimpleNode(JJTGROUPBYSPEC
);
977 boolean jjtc000
= true;
978 jjtree
.openNodeScope(jjtn000
);GroupBySpec spec
= null;
980 spec
= GroupByExpr(null);
981 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
984 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
986 jj_consume_token(INNER
);
990 jj_consume_token(OUTER
);
994 jj_consume_token(-1);
995 throw new ParseException();
1002 jjtree
.closeNodeScope(jjtn000
, true);
1004 {if (true) return spec
;}
1005 } catch (Throwable jjte000
) {
1007 jjtree
.clearNodeScope(jjtn000
);
1012 if (jjte000
instanceof RuntimeException
) {
1013 {if (true) throw (RuntimeException
)jjte000
;}
1015 if (jjte000
instanceof ParseException
) {
1016 {if (true) throw (ParseException
)jjte000
;}
1018 {if (true) throw (Error
)jjte000
;}
1021 jjtree
.closeNodeScope(jjtn000
, true);
1024 throw new Error("Missing return statement in function");
1027 final public LogicalOperator
CrossClause() throws ParseException
{
1028 /*@bgen(jjtree) CrossClause */
1029 SimpleNode jjtn000
= new SimpleNode(JJTCROSSCLAUSE
);
1030 boolean jjtc000
= true;
1031 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
; ArrayList
<LogicalOperator
> inputs
= new ArrayList
<LogicalOperator
>();
1037 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1042 jj_la1
[23] = jj_gen
;
1045 jj_consume_token(56);
1049 jjtree
.closeNodeScope(jjtn000
, true);
1051 {if (true) return rewriteCross(inputs
);}
1052 } catch (Throwable jjte000
) {
1054 jjtree
.clearNodeScope(jjtn000
);
1059 if (jjte000
instanceof RuntimeException
) {
1060 {if (true) throw (RuntimeException
)jjte000
;}
1062 if (jjte000
instanceof ParseException
) {
1063 {if (true) throw (ParseException
)jjte000
;}
1065 {if (true) throw (Error
)jjte000
;}
1068 jjtree
.closeNodeScope(jjtn000
, true);
1071 throw new Error("Missing return statement in function");
1074 final public LogicalOperator
UnionClause() throws ParseException
{
1075 /*@bgen(jjtree) UnionClause */
1076 SimpleNode jjtn000
= new SimpleNode(JJTUNIONCLAUSE
);
1077 boolean jjtc000
= true;
1078 jjtree
.openNodeScope(jjtn000
);LogicalOperator op
; ArrayList
<LogicalOperator
> inputs
= new ArrayList
<LogicalOperator
>();
1084 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1089 jj_la1
[24] = jj_gen
;
1092 jj_consume_token(56);
1096 jjtree
.closeNodeScope(jjtn000
, true);
1098 {if (true) return new LOUnion(pigContext
, inputs
);}
1099 } catch (Throwable jjte000
) {
1101 jjtree
.clearNodeScope(jjtn000
);
1106 if (jjte000
instanceof RuntimeException
) {
1107 {if (true) throw (RuntimeException
)jjte000
;}
1109 if (jjte000
instanceof ParseException
) {
1110 {if (true) throw (ParseException
)jjte000
;}
1112 {if (true) throw (Error
)jjte000
;}
1115 jjtree
.closeNodeScope(jjtn000
, true);
1118 throw new Error("Missing return statement in function");
1121 final public LogicalOperator
ForEachClause() throws ParseException
{
1122 /*@bgen(jjtree) ForEachClause */
1123 SimpleNode jjtn000
= new SimpleNode(JJTFOREACHCLAUSE
);
1124 boolean jjtc000
= true;
1125 jjtree
.openNodeScope(jjtn000
);EvalSpecPipeAndSchema specPipeAndSchema
= null; LogicalOperator input
, op
;
1127 input
= NestedExpr();
1128 specPipeAndSchema
= NestedBlock(input
.outputSchema());
1129 jjtree
.closeNodeScope(jjtn000
, true);
1131 op
= new LOEval(pigContext
, input
, specPipeAndSchema
.pipe
);
1132 op
.schema
= specPipeAndSchema
.schema
;
1133 {if (true) return op
;}
1134 } catch (Throwable jjte000
) {
1136 jjtree
.clearNodeScope(jjtn000
);
1141 if (jjte000
instanceof RuntimeException
) {
1142 {if (true) throw (RuntimeException
)jjte000
;}
1144 if (jjte000
instanceof ParseException
) {
1145 {if (true) throw (ParseException
)jjte000
;}
1147 {if (true) throw (Error
)jjte000
;}
1150 jjtree
.closeNodeScope(jjtn000
, true);
1153 throw new Error("Missing return statement in function");
1156 final public EvalSpecPipeAndSchema
NestedBlock(SchemaItem over
) throws ParseException
{
1157 /*@bgen(jjtree) NestedBlock */
1158 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDBLOCK
);
1159 boolean jjtc000
= true;
1160 jjtree
.openNodeScope(jjtn000
);EvalSpecPipeAndSchema pipeAndSchema
; Map
<String
, EvalItem
> pipes
= new HashMap
<String
, EvalItem
>();
1162 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1164 pipeAndSchema
= GenerateStatement(over
,pipes
);
1167 jj_consume_token(57);
1170 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1175 jj_la1
[25] = jj_gen
;
1178 NestedCommand(over
,pipes
);
1179 jj_consume_token(53);
1181 pipeAndSchema
= GenerateStatement(over
,pipes
);
1182 jj_consume_token(53);
1183 jj_consume_token(58);
1186 jj_la1
[26] = jj_gen
;
1187 jj_consume_token(-1);
1188 throw new ParseException();
1190 jjtree
.closeNodeScope(jjtn000
, true);
1192 {if (true) return pipeAndSchema
;}
1193 } catch (Throwable jjte000
) {
1195 jjtree
.clearNodeScope(jjtn000
);
1200 if (jjte000
instanceof RuntimeException
) {
1201 {if (true) throw (RuntimeException
)jjte000
;}
1203 if (jjte000
instanceof ParseException
) {
1204 {if (true) throw (ParseException
)jjte000
;}
1206 {if (true) throw (Error
)jjte000
;}
1209 jjtree
.closeNodeScope(jjtn000
, true);
1212 throw new Error("Missing return statement in function");
1215 final public void NestedCommand(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1216 /*@bgen(jjtree) NestedCommand */
1217 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDCOMMAND
);
1218 boolean jjtc000
= true;
1219 jjtree
.openNodeScope(jjtn000
);Token t
; EvalItem item
;
1221 t
= jj_consume_token(IDENTIFIER
);
1222 jj_consume_token(52);
1223 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1229 item
= InfixExpr(over
,pipes
);
1232 item
= NestedFilter(over
,pipes
);
1236 item
= NestedSortOrArrange(over
,pipes
);
1239 item
= NestedDistinct(over
,pipes
);
1242 jj_la1
[27] = jj_gen
;
1243 jj_consume_token(-1);
1244 throw new ParseException();
1246 jjtree
.closeNodeScope(jjtn000
, true);
1248 pipes
.put(t
.image
,item
);
1249 } catch (Throwable jjte000
) {
1251 jjtree
.clearNodeScope(jjtn000
);
1256 if (jjte000
instanceof RuntimeException
) {
1257 {if (true) throw (RuntimeException
)jjte000
;}
1259 if (jjte000
instanceof ParseException
) {
1260 {if (true) throw (ParseException
)jjte000
;}
1262 {if (true) throw (Error
)jjte000
;}
1265 jjtree
.closeNodeScope(jjtn000
, true);
1270 final public EvalItem
NestedFilter(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1271 /*@bgen(jjtree) NestedFilter */
1272 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDFILTER
);
1273 boolean jjtc000
= true;
1274 jjtree
.openNodeScope(jjtn000
);Cond cond
; EvalItem item
; SchemaItem subSchema
= null;
1276 jj_consume_token(FILTER
);
1277 item
= BaseEvalItem(over
,pipes
);
1278 subSchema
= item
.mapInputSchema(over
);
1279 jj_consume_token(BY
);
1280 cond
= PCond(subSchema
,null);
1281 jjtree
.closeNodeScope(jjtn000
, true);
1283 {if (true) return copyItemAndAddSpec(item
,new FilterSpec(cond
));}
1284 } catch (Throwable jjte000
) {
1286 jjtree
.clearNodeScope(jjtn000
);
1291 if (jjte000
instanceof RuntimeException
) {
1292 {if (true) throw (RuntimeException
)jjte000
;}
1294 if (jjte000
instanceof ParseException
) {
1295 {if (true) throw (ParseException
)jjte000
;}
1297 {if (true) throw (Error
)jjte000
;}
1300 jjtree
.closeNodeScope(jjtn000
, true);
1303 throw new Error("Missing return statement in function");
1306 final public EvalItem
NestedSortOrArrange(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1307 /*@bgen(jjtree) NestedSortOrArrange */
1308 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDSORTORARRANGE
);
1309 boolean jjtc000
= true;
1310 jjtree
.openNodeScope(jjtn000
);EvalItemList list
; EvalItem item
; SchemaItem subSchema
= null; Token t
;
1312 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1314 t
= jj_consume_token(ORDER
);
1317 t
= jj_consume_token(ARRANGE
);
1320 jj_la1
[28] = jj_gen
;
1321 jj_consume_token(-1);
1322 throw new ParseException();
1324 item
= BaseEvalItem(over
,pipes
);
1325 subSchema
= item
.mapInputSchema(over
);
1326 jj_consume_token(BY
);
1327 list
= SimpleProj(subSchema
);
1328 jjtree
.closeNodeScope(jjtn000
, true);
1330 {if (true) return copyItemAndAddSpec(item
,new SortArrangeSpec(list
,t
.image
.equalsIgnoreCase("arrange")));}
1331 } catch (Throwable jjte000
) {
1333 jjtree
.clearNodeScope(jjtn000
);
1338 if (jjte000
instanceof RuntimeException
) {
1339 {if (true) throw (RuntimeException
)jjte000
;}
1341 if (jjte000
instanceof ParseException
) {
1342 {if (true) throw (ParseException
)jjte000
;}
1344 {if (true) throw (Error
)jjte000
;}
1347 jjtree
.closeNodeScope(jjtn000
, true);
1350 throw new Error("Missing return statement in function");
1353 final public EvalItem
NestedDistinct(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1354 /*@bgen(jjtree) NestedDistinct */
1355 SimpleNode jjtn000
= new SimpleNode(JJTNESTEDDISTINCT
);
1356 boolean jjtc000
= true;
1357 jjtree
.openNodeScope(jjtn000
);EvalItemList list
; EvalItem item
; LogicalOperator subOp
= null; Token t
;
1359 jj_consume_token(DISTINCT
);
1360 item
= BaseEvalItem(over
,pipes
);
1361 jjtree
.closeNodeScope(jjtn000
, true);
1363 list
= new EvalItemList(pigContext
); list
.add(new StarEvalItem(pigContext
));
1364 {if (true) return copyItemAndAddSpec(item
,new DistinctSpec(list
));}
1365 } catch (Throwable jjte000
) {
1367 jjtree
.clearNodeScope(jjtn000
);
1372 if (jjte000
instanceof RuntimeException
) {
1373 {if (true) throw (RuntimeException
)jjte000
;}
1375 if (jjte000
instanceof ParseException
) {
1376 {if (true) throw (ParseException
)jjte000
;}
1378 {if (true) throw (Error
)jjte000
;}
1381 jjtree
.closeNodeScope(jjtn000
, true);
1384 throw new Error("Missing return statement in function");
1387 final public EvalSpecPipeAndSchema
GenerateStatement(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1388 /*@bgen(jjtree) GenerateStatement */
1389 SimpleNode jjtn000
= new SimpleNode(JJTGENERATESTATEMENT
);
1390 boolean jjtc000
= true;
1391 jjtree
.openNodeScope(jjtn000
);EvalSpecPipeAndSchema pipeAndSchema
= new EvalSpecPipeAndSchema(); EvalSpecPipe pipe
= null; SchemaItemList schema
;
1393 jj_consume_token(GENERATE
);
1394 pipe
= FlattenedGenerateItemList(over
,pipes
);
1395 jjtree
.closeNodeScope(jjtn000
, true);
1397 pipeAndSchema
.pipe
= pipe
;
1398 {if (true) return pipeAndSchema
;}
1399 } catch (Throwable jjte000
) {
1401 jjtree
.clearNodeScope(jjtn000
);
1406 if (jjte000
instanceof RuntimeException
) {
1407 {if (true) throw (RuntimeException
)jjte000
;}
1409 if (jjte000
instanceof ParseException
) {
1410 {if (true) throw (ParseException
)jjte000
;}
1412 {if (true) throw (Error
)jjte000
;}
1415 jjtree
.closeNodeScope(jjtn000
, true);
1418 throw new Error("Missing return statement in function");
1421 final public EvalSpecPipe
FlattenedGenerateItemList(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1422 /*@bgen(jjtree) FlattenedGenerateItemList */
1423 SimpleNode jjtn000
= new SimpleNode(JJTFLATTENEDGENERATEITEMLIST
);
1424 boolean jjtc000
= true;
1425 jjtree
.openNodeScope(jjtn000
);EvalSpecPipe pipe
= new EvalSpecPipe(pigContext
); EvalItemList list
= new EvalItemList(pigContext
); EvalItem item
;
1427 item
= FlattenedGenerateItem(over
,pipes
);
1431 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1436 jj_la1
[29] = jj_gen
;
1439 jj_consume_token(56);
1440 item
= FlattenedGenerateItem(over
,pipes
);
1443 jjtree
.closeNodeScope(jjtn000
, true);
1445 pipe
.add(list
); {if (true) return pipe
;}
1446 } catch (Throwable jjte000
) {
1448 jjtree
.clearNodeScope(jjtn000
);
1453 if (jjte000
instanceof RuntimeException
) {
1454 {if (true) throw (RuntimeException
)jjte000
;}
1456 if (jjte000
instanceof ParseException
) {
1457 {if (true) throw (ParseException
)jjte000
;}
1459 {if (true) throw (Error
)jjte000
;}
1462 jjtree
.closeNodeScope(jjtn000
, true);
1465 throw new Error("Missing return statement in function");
1468 final public EvalItem
FlattenedGenerateItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1469 /*@bgen(jjtree) FlattenedGenerateItem */
1470 SimpleNode jjtn000
= new SimpleNode(JJTFLATTENEDGENERATEITEM
);
1471 boolean jjtc000
= true;
1472 jjtree
.openNodeScope(jjtn000
);EvalItem item
; SchemaItem schema
= null;
1474 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1476 jj_consume_token(FLATTEN
);
1477 jj_consume_token(54);
1478 item
= GenerateItem(over
,pipes
);
1479 jj_consume_token(55);
1480 if (!(item
instanceof NestableEvalItem
) ||
1481 (item
instanceof AtomFuncEvalItem
) ){
1482 {if (true) throw new ParseException("Cannot flatten atom field");}
1485 EvalItemList list
= new EvalItemList(pigContext
);
1486 list
.add(new StarEvalItem(pigContext
));
1487 ((NestableEvalItem
)item
).subColSpec
= list
;
1495 item
= GenerateItem(over
,pipes
);
1498 jj_la1
[30] = jj_gen
;
1499 jj_consume_token(-1);
1500 throw new ParseException();
1502 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1504 jj_consume_token(AS
);
1505 schema
= SchemaElement();
1508 jj_la1
[31] = jj_gen
;
1511 jjtree
.closeNodeScope(jjtn000
, true);
1513 item
.schema
= schema
;
1514 {if (true) return item
;}
1515 } catch (Throwable jjte000
) {
1517 jjtree
.clearNodeScope(jjtn000
);
1522 if (jjte000
instanceof RuntimeException
) {
1523 {if (true) throw (RuntimeException
)jjte000
;}
1525 if (jjte000
instanceof ParseException
) {
1526 {if (true) throw (ParseException
)jjte000
;}
1528 {if (true) throw (Error
)jjte000
;}
1531 jjtree
.closeNodeScope(jjtn000
, true);
1534 throw new Error("Missing return statement in function");
1537 final public EvalItem
GenerateItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1538 /*@bgen(jjtree) GenerateItem */
1539 SimpleNode jjtn000
= new SimpleNode(JJTGENERATEITEM
);
1540 boolean jjtc000
= true;
1541 jjtree
.openNodeScope(jjtn000
);EvalItem item
;
1543 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1549 item
= InfixExpr(over
,pipes
);
1555 jj_la1
[32] = jj_gen
;
1556 jj_consume_token(-1);
1557 throw new ParseException();
1559 jjtree
.closeNodeScope(jjtn000
, true);
1561 {if (true) return item
;}
1562 } catch (Throwable jjte000
) {
1564 jjtree
.clearNodeScope(jjtn000
);
1569 if (jjte000
instanceof RuntimeException
) {
1570 {if (true) throw (RuntimeException
)jjte000
;}
1572 if (jjte000
instanceof ParseException
) {
1573 {if (true) throw (ParseException
)jjte000
;}
1575 {if (true) throw (Error
)jjte000
;}
1578 jjtree
.closeNodeScope(jjtn000
, true);
1581 throw new Error("Missing return statement in function");
1584 final public EvalItem
InfixExpr(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1585 /*@bgen(jjtree) InfixExpr */
1586 SimpleNode jjtn000
= new SimpleNode(JJTINFIXEXPR
);
1587 boolean jjtc000
= true;
1588 jjtree
.openNodeScope(jjtn000
);EvalItem expr
;
1590 expr
= AdditiveExpr(over
,pipes
);
1591 jjtree
.closeNodeScope(jjtn000
, true);
1593 {if (true) return expr
;}
1594 } catch (Throwable jjte000
) {
1596 jjtree
.clearNodeScope(jjtn000
);
1601 if (jjte000
instanceof RuntimeException
) {
1602 {if (true) throw (RuntimeException
)jjte000
;}
1604 if (jjte000
instanceof ParseException
) {
1605 {if (true) throw (ParseException
)jjte000
;}
1607 {if (true) throw (Error
)jjte000
;}
1610 jjtree
.closeNodeScope(jjtn000
, true);
1613 throw new Error("Missing return statement in function");
1616 final public EvalItem
AdditiveExpr(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1617 /*@bgen(jjtree) AdditiveExpr */
1618 SimpleNode jjtn000
= new SimpleNode(JJTADDITIVEEXPR
);
1619 boolean jjtc000
= true;
1620 jjtree
.openNodeScope(jjtn000
);Token t
; EvalItem lhs
, rhs
; EvalItemList args
;
1622 lhs
= MultiplicativeExpr(over
,pipes
);
1625 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1631 jj_la1
[33] = jj_gen
;
1634 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1636 t
= jj_consume_token(59);
1639 t
= jj_consume_token(60);
1642 jj_la1
[34] = jj_gen
;
1643 jj_consume_token(-1);
1644 throw new ParseException();
1646 rhs
= MultiplicativeExpr(over
,pipes
);
1647 assertAtomic(lhs
,true);
1648 assertAtomic(rhs
,true);
1649 args
= new EvalItemList(pigContext
);
1652 if (t
.image
.equals("+")){
1653 lhs
= newFuncEvalItem((EvalFunc
)pigContext
.getUDF("ADD"), args
);
1655 lhs
= newFuncEvalItem((EvalFunc
)pigContext
.getUDF("SUBTRACT"), args
);
1658 jjtree
.closeNodeScope(jjtn000
, true);
1660 {if (true) return lhs
;}
1661 } catch (Throwable jjte000
) {
1663 jjtree
.clearNodeScope(jjtn000
);
1668 if (jjte000
instanceof RuntimeException
) {
1669 {if (true) throw (RuntimeException
)jjte000
;}
1671 if (jjte000
instanceof ParseException
) {
1672 {if (true) throw (ParseException
)jjte000
;}
1674 {if (true) throw (Error
)jjte000
;}
1677 jjtree
.closeNodeScope(jjtn000
, true);
1680 throw new Error("Missing return statement in function");
1683 final public EvalItem
MultiplicativeExpr(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1684 /*@bgen(jjtree) MultiplicativeExpr */
1685 SimpleNode jjtn000
= new SimpleNode(JJTMULTIPLICATIVEEXPR
);
1686 boolean jjtc000
= true;
1687 jjtree
.openNodeScope(jjtn000
);Token t
; EvalItem lhs
, rhs
; EvalItemList args
;
1689 lhs
= UnaryExpr(over
,pipes
);
1692 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1698 jj_la1
[35] = jj_gen
;
1701 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1703 t
= jj_consume_token(STAR
);
1706 t
= jj_consume_token(61);
1709 jj_la1
[36] = jj_gen
;
1710 jj_consume_token(-1);
1711 throw new ParseException();
1713 rhs
= UnaryExpr(over
,pipes
);
1714 assertAtomic(lhs
,true);
1715 assertAtomic(rhs
,true);
1716 args
= new EvalItemList(pigContext
);
1719 if (t
.image
.equals("*")){
1720 lhs
= newFuncEvalItem((EvalFunc
)pigContext
.getUDF("MULTIPLY"), args
);
1722 lhs
= newFuncEvalItem((EvalFunc
)pigContext
.getUDF("DIVIDE"), args
);
1725 jjtree
.closeNodeScope(jjtn000
, true);
1727 {if (true) return lhs
;}
1728 } catch (Throwable jjte000
) {
1730 jjtree
.clearNodeScope(jjtn000
);
1735 if (jjte000
instanceof RuntimeException
) {
1736 {if (true) throw (RuntimeException
)jjte000
;}
1738 if (jjte000
instanceof ParseException
) {
1739 {if (true) throw (ParseException
)jjte000
;}
1741 {if (true) throw (Error
)jjte000
;}
1744 jjtree
.closeNodeScope(jjtn000
, true);
1747 throw new Error("Missing return statement in function");
1750 final public EvalItem
UnaryExpr(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1751 /*@bgen(jjtree) UnaryExpr */
1752 SimpleNode jjtn000
= new SimpleNode(JJTUNARYEXPR
);
1753 boolean jjtc000
= true;
1754 jjtree
.openNodeScope(jjtn000
);EvalItem expr
;
1756 if (jj_2_8(2147483647)) {
1757 expr
= BaseEvalItem(over
,pipes
);
1759 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1761 jj_consume_token(54);
1762 expr
= InfixExpr(over
,pipes
);
1763 jj_consume_token(55);
1766 jj_la1
[37] = jj_gen
;
1767 jj_consume_token(-1);
1768 throw new ParseException();
1771 jjtree
.closeNodeScope(jjtn000
, true);
1773 {if (true) return expr
;}
1774 } catch (Throwable jjte000
) {
1776 jjtree
.clearNodeScope(jjtn000
);
1781 if (jjte000
instanceof RuntimeException
) {
1782 {if (true) throw (RuntimeException
)jjte000
;}
1784 if (jjte000
instanceof ParseException
) {
1785 {if (true) throw (ParseException
)jjte000
;}
1787 {if (true) throw (Error
)jjte000
;}
1790 jjtree
.closeNodeScope(jjtn000
, true);
1793 throw new Error("Missing return statement in function");
1796 final public EvalItem
BaseEvalItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1797 /*@bgen(jjtree) BaseEvalItem */
1798 SimpleNode jjtn000
= new SimpleNode(JJTBASEEVALITEM
);
1799 boolean jjtc000
= true;
1800 jjtree
.openNodeScope(jjtn000
);EvalItem item
;EvalItemList projection
; SchemaItem subSchema
= null;
1802 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1810 if (jj_2_9(2147483647)) {
1811 item
= FuncEvalItem(over
,pipes
);
1813 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1817 item
= PColEvalItem(over
,pipes
);
1820 item
= BinCond(over
,pipes
);
1823 jj_la1
[38] = jj_gen
;
1824 jj_consume_token(-1);
1825 throw new ParseException();
1828 subSchema
= item
.mapInputSchema(over
);
1829 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1831 jj_consume_token(62);
1832 projection
= BracketedSimpleProj(subSchema
);
1833 assertAtomic(item
,false);
1834 ((NestableEvalItem
)item
).addNestedEvalSpec(projection
);
1837 jj_la1
[39] = jj_gen
;
1842 jj_la1
[40] = jj_gen
;
1843 jj_consume_token(-1);
1844 throw new ParseException();
1846 jjtree
.closeNodeScope(jjtn000
, true);
1848 {if (true) return item
;}
1849 } catch (Throwable jjte000
) {
1851 jjtree
.clearNodeScope(jjtn000
);
1856 if (jjte000
instanceof RuntimeException
) {
1857 {if (true) throw (RuntimeException
)jjte000
;}
1859 if (jjte000
instanceof ParseException
) {
1860 {if (true) throw (ParseException
)jjte000
;}
1862 {if (true) throw (Error
)jjte000
;}
1865 jjtree
.closeNodeScope(jjtn000
, true);
1868 throw new Error("Missing return statement in function");
1871 final public NestableEvalItem
BinCond(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1872 /*@bgen(jjtree) BinCond */
1873 SimpleNode jjtn000
= new SimpleNode(JJTBINCOND
);
1874 boolean jjtc000
= true;
1875 jjtree
.openNodeScope(jjtn000
);Cond cond
; EvalItem ifTrue
, ifFalse
; NestableEvalItem ret
= null;
1877 jj_consume_token(54);
1878 cond
= PCond(over
,pipes
);
1879 jj_consume_token(63);
1880 ifTrue
= BaseEvalItem(over
,pipes
);
1881 jj_consume_token(64);
1882 ifFalse
= BaseEvalItem(over
,pipes
);
1883 jj_consume_token(55);
1884 jjtree
.closeNodeScope(jjtn000
, true);
1886 {if (true) return new BinCond(pigContext
, cond
,ifTrue
,ifFalse
);}
1887 } catch (Throwable jjte000
) {
1889 jjtree
.clearNodeScope(jjtn000
);
1894 if (jjte000
instanceof RuntimeException
) {
1895 {if (true) throw (RuntimeException
)jjte000
;}
1897 if (jjte000
instanceof ParseException
) {
1898 {if (true) throw (ParseException
)jjte000
;}
1900 {if (true) throw (Error
)jjte000
;}
1903 jjtree
.closeNodeScope(jjtn000
, true);
1906 throw new Error("Missing return statement in function");
1909 final public NestableEvalItem
FuncEvalItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1910 /*@bgen(jjtree) FuncEvalItem */
1911 SimpleNode jjtn000
= new SimpleNode(JJTFUNCEVALITEM
);
1912 boolean jjtc000
= true;
1913 jjtree
.openNodeScope(jjtn000
);EvalFunc func
; EvalItemList args
; NestableEvalItem i
;
1915 func
= EvalFunction();
1916 jj_consume_token(54);
1917 args
= EvalArgs(over
,pipes
);
1918 jj_consume_token(55);
1919 i
= newFuncEvalItem(func
, args
);
1920 jjtree
.closeNodeScope(jjtn000
, true);
1922 {if (true) return i
;}
1923 } catch (Throwable jjte000
) {
1925 jjtree
.clearNodeScope(jjtn000
);
1930 if (jjte000
instanceof RuntimeException
) {
1931 {if (true) throw (RuntimeException
)jjte000
;}
1933 if (jjte000
instanceof ParseException
) {
1934 {if (true) throw (ParseException
)jjte000
;}
1936 {if (true) throw (Error
)jjte000
;}
1939 jjtree
.closeNodeScope(jjtn000
, true);
1942 throw new Error("Missing return statement in function");
1945 final public EvalItemList
EvalArgs(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
1946 /*@bgen(jjtree) EvalArgs */
1947 SimpleNode jjtn000
= new SimpleNode(JJTEVALARGS
);
1948 boolean jjtc000
= true;
1949 jjtree
.openNodeScope(jjtn000
);EvalItemList list
= new EvalItemList(pigContext
); EvalItem item
;
1951 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1958 item
= EvalArgsItem(over
,pipes
);
1962 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
1967 jj_la1
[41] = jj_gen
;
1970 jj_consume_token(56);
1971 item
= EvalArgsItem(over
,pipes
);
1976 jj_la1
[42] = jj_gen
;
1977 list
= new EvalItemList(pigContext
);
1979 jjtree
.closeNodeScope(jjtn000
, true);
1981 if (!list
.isSimple()){
1982 {if (true) throw new ParseException("Cannot have non-jave function as an argument");}
1984 {if (true) return list
;}
1985 } catch (Throwable jjte000
) {
1987 jjtree
.clearNodeScope(jjtn000
);
1992 if (jjte000
instanceof RuntimeException
) {
1993 {if (true) throw (RuntimeException
)jjte000
;}
1995 if (jjte000
instanceof ParseException
) {
1996 {if (true) throw (ParseException
)jjte000
;}
1998 {if (true) throw (Error
)jjte000
;}
2001 jjtree
.closeNodeScope(jjtn000
, true);
2004 throw new Error("Missing return statement in function");
2007 final public EvalItem
EvalArgsItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
2008 /*@bgen(jjtree) EvalArgsItem */
2009 SimpleNode jjtn000
= new SimpleNode(JJTEVALARGSITEM
);
2010 boolean jjtc000
= true;
2011 jjtree
.openNodeScope(jjtn000
);EvalItem item
;
2013 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2019 item
= InfixExpr(over
,pipes
);
2025 jj_la1
[43] = jj_gen
;
2026 jj_consume_token(-1);
2027 throw new ParseException();
2029 jjtree
.closeNodeScope(jjtn000
, true);
2031 {if (true) return item
;}
2032 } catch (Throwable jjte000
) {
2034 jjtree
.clearNodeScope(jjtn000
);
2039 if (jjte000
instanceof RuntimeException
) {
2040 {if (true) throw (RuntimeException
)jjte000
;}
2042 if (jjte000
instanceof ParseException
) {
2043 {if (true) throw (ParseException
)jjte000
;}
2045 {if (true) throw (Error
)jjte000
;}
2048 jjtree
.closeNodeScope(jjtn000
, true);
2051 throw new Error("Missing return statement in function");
2054 // Map a user schema onto a LogicalOperator
2055 final public SchemaItemList
AsClause() throws ParseException
{
2056 /*@bgen(jjtree) AsClause */
2057 SimpleNode jjtn000
= new SimpleNode(JJTASCLAUSE
);
2058 boolean jjtc000
= true;
2059 jjtree
.openNodeScope(jjtn000
);Token t1
; SchemaItem item
= null; SchemaItemList list
= new SchemaItemList(); Token t
= null;
2061 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2064 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2066 t
= jj_consume_token(IDENTIFIER
);
2069 t
= jj_consume_token(GROUP
);
2072 jj_la1
[44] = jj_gen
;
2073 jj_consume_token(-1);
2074 throw new ParseException();
2076 jj_consume_token(64);
2079 jj_la1
[45] = jj_gen
;
2082 jj_consume_token(54);
2083 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2088 item
= SchemaElement();
2092 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2097 jj_la1
[46] = jj_gen
;
2100 jj_consume_token(56);
2101 item
= SchemaElement();
2106 jj_la1
[47] = jj_gen
;
2107 list
= new SchemaItemList();
2109 jj_consume_token(55);
2110 jjtree
.closeNodeScope(jjtn000
, true);
2113 list
.alias
= t
.image
;
2114 {if (true) return list
;}
2115 } catch (Throwable jjte000
) {
2117 jjtree
.clearNodeScope(jjtn000
);
2122 if (jjte000
instanceof RuntimeException
) {
2123 {if (true) throw (RuntimeException
)jjte000
;}
2125 if (jjte000
instanceof ParseException
) {
2126 {if (true) throw (ParseException
)jjte000
;}
2128 {if (true) throw (Error
)jjte000
;}
2131 jjtree
.closeNodeScope(jjtn000
, true);
2134 throw new Error("Missing return statement in function");
2137 final public SchemaItem
SchemaElement() throws ParseException
{
2138 /*@bgen(jjtree) SchemaElement */
2139 SimpleNode jjtn000
= new SimpleNode(JJTSCHEMAELEMENT
);
2140 boolean jjtc000
= true;
2141 jjtree
.openNodeScope(jjtn000
);Token t1
; SchemaItem item
= null;
2143 if (jj_2_10(2147483647)) {
2145 } else if (jj_2_11(2147483647)) {
2146 item
= SchemaTuple();
2147 } else if (jj_2_12(2147483647)) {
2148 item
= SchemaField();
2150 jj_consume_token(-1);
2151 throw new ParseException();
2153 jjtree
.closeNodeScope(jjtn000
, true);
2155 {if (true) return item
;}
2156 } catch (Throwable jjte000
) {
2158 jjtree
.clearNodeScope(jjtn000
);
2163 if (jjte000
instanceof RuntimeException
) {
2164 {if (true) throw (RuntimeException
)jjte000
;}
2166 if (jjte000
instanceof ParseException
) {
2167 {if (true) throw (ParseException
)jjte000
;}
2169 {if (true) throw (Error
)jjte000
;}
2172 jjtree
.closeNodeScope(jjtn000
, true);
2175 throw new Error("Missing return statement in function");
2178 final public SchemaItem
SchemaField() throws ParseException
{
2179 /*@bgen(jjtree) SchemaField */
2180 SimpleNode jjtn000
= new SimpleNode(JJTSCHEMAFIELD
);
2181 boolean jjtc000
= true;
2182 jjtree
.openNodeScope(jjtn000
);Token t1
;
2184 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2186 t1
= jj_consume_token(IDENTIFIER
);
2189 t1
= jj_consume_token(GROUP
);
2192 jj_la1
[48] = jj_gen
;
2193 jj_consume_token(-1);
2194 throw new ParseException();
2196 jjtree
.closeNodeScope(jjtn000
, true);
2198 {if (true) return new SchemaField(t1
.image
);}
2201 jjtree
.closeNodeScope(jjtn000
, true);
2204 throw new Error("Missing return statement in function");
2207 final public SchemaItem
SchemaTuple() throws ParseException
{
2208 /*@bgen(jjtree) SchemaTuple */
2209 SimpleNode jjtn000
= new SimpleNode(JJTSCHEMATUPLE
);
2210 boolean jjtc000
= true;
2211 jjtree
.openNodeScope(jjtn000
);Token t1
= null; SchemaItem item
= null; SchemaItemList list
= new SchemaItemList();
2213 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2216 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2218 t1
= jj_consume_token(IDENTIFIER
);
2221 t1
= jj_consume_token(GROUP
);
2224 jj_la1
[49] = jj_gen
;
2225 jj_consume_token(-1);
2226 throw new ParseException();
2228 jj_consume_token(64);
2231 jj_la1
[50] = jj_gen
;
2234 jj_consume_token(54);
2235 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2240 item
= SchemaElement();
2244 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2249 jj_la1
[51] = jj_gen
;
2252 jj_consume_token(56);
2253 item
= SchemaElement();
2258 jj_la1
[52] = jj_gen
;
2261 jj_consume_token(55);
2262 jjtree
.closeNodeScope(jjtn000
, true);
2265 list
.alias
= t1
.image
;
2266 list
.setIsBag(false);
2267 {if (true) return list
;}
2268 } catch (Throwable jjte000
) {
2270 jjtree
.clearNodeScope(jjtn000
);
2275 if (jjte000
instanceof RuntimeException
) {
2276 {if (true) throw (RuntimeException
)jjte000
;}
2278 if (jjte000
instanceof ParseException
) {
2279 {if (true) throw (ParseException
)jjte000
;}
2281 {if (true) throw (Error
)jjte000
;}
2284 jjtree
.closeNodeScope(jjtn000
, true);
2287 throw new Error("Missing return statement in function");
2290 final public SchemaItem
SchemaBag() throws ParseException
{
2291 /*@bgen(jjtree) SchemaBag */
2292 SimpleNode jjtn000
= new SimpleNode(JJTSCHEMABAG
);
2293 boolean jjtc000
= true;
2294 jjtree
.openNodeScope(jjtn000
);Token t1
=null; SchemaItem item
= null; SchemaItemList list
= new SchemaItemList();
2296 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2298 t1
= jj_consume_token(IDENTIFIER
);
2299 jj_consume_token(64);
2302 jj_la1
[53] = jj_gen
;
2305 jj_consume_token(65);
2306 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2311 item
= SchemaElement();
2315 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2320 jj_la1
[54] = jj_gen
;
2323 jj_consume_token(56);
2324 item
= SchemaElement();
2329 jj_la1
[55] = jj_gen
;
2332 jj_consume_token(66);
2333 jjtree
.closeNodeScope(jjtn000
, true);
2336 list
.alias
= t1
.image
;
2337 list
.setIsBag(true);
2338 {if (true) return list
;}
2339 } catch (Throwable jjte000
) {
2341 jjtree
.clearNodeScope(jjtn000
);
2346 if (jjte000
instanceof RuntimeException
) {
2347 {if (true) throw (RuntimeException
)jjte000
;}
2349 if (jjte000
instanceof ParseException
) {
2350 {if (true) throw (ParseException
)jjte000
;}
2352 {if (true) throw (Error
)jjte000
;}
2355 jjtree
.closeNodeScope(jjtn000
, true);
2358 throw new Error("Missing return statement in function");
2361 // Used in serialization and deserialization
2362 final public EvalSpecPipe
PEvalSpecPipe() throws ParseException
{
2363 /*@bgen(jjtree) PEvalSpecPipe */
2364 SimpleNode jjtn000
= new SimpleNode(JJTPEVALSPECPIPE
);
2365 boolean jjtc000
= true;
2366 jjtree
.openNodeScope(jjtn000
);EvalSpecPipe pipe
= new EvalSpecPipe(pigContext
); EvalSpec spec
;
2370 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2375 jj_la1
[56] = jj_gen
;
2378 jj_consume_token(65);
2380 jj_consume_token(66);
2383 jjtree
.closeNodeScope(jjtn000
, true);
2385 {if (true) return pipe
;}
2386 } catch (Throwable jjte000
) {
2388 jjtree
.clearNodeScope(jjtn000
);
2393 if (jjte000
instanceof RuntimeException
) {
2394 {if (true) throw (RuntimeException
)jjte000
;}
2396 if (jjte000
instanceof ParseException
) {
2397 {if (true) throw (ParseException
)jjte000
;}
2399 {if (true) throw (Error
)jjte000
;}
2402 jjtree
.closeNodeScope(jjtn000
, true);
2405 throw new Error("Missing return statement in function");
2408 final public EvalSpec
PEvalSpec() throws ParseException
{
2409 /*@bgen(jjtree) PEvalSpec */
2410 SimpleNode jjtn000
= new SimpleNode(JJTPEVALSPEC
);
2411 boolean jjtc000
= true;
2412 jjtree
.openNodeScope(jjtn000
);EvalSpec spec
;
2414 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2416 jj_consume_token(FILTER
);
2420 jj_consume_token(EVAL
);
2421 spec
= PEvalItemList();
2429 jj_la1
[57] = jj_gen
;
2430 jj_consume_token(-1);
2431 throw new ParseException();
2433 jjtree
.closeNodeScope(jjtn000
, true);
2435 {if (true) return spec
;}
2436 } catch (Throwable jjte000
) {
2438 jjtree
.clearNodeScope(jjtn000
);
2443 if (jjte000
instanceof RuntimeException
) {
2444 {if (true) throw (RuntimeException
)jjte000
;}
2446 if (jjte000
instanceof ParseException
) {
2447 {if (true) throw (ParseException
)jjte000
;}
2449 {if (true) throw (Error
)jjte000
;}
2452 jjtree
.closeNodeScope(jjtn000
, true);
2455 throw new Error("Missing return statement in function");
2458 final public EvalSpec
PFilter() throws ParseException
{
2459 /*@bgen(jjtree) PFilter */
2460 SimpleNode jjtn000
= new SimpleNode(JJTPFILTER
);
2461 boolean jjtc000
= true;
2462 jjtree
.openNodeScope(jjtn000
);Cond cond
;
2464 cond
= PCond(null,null);
2465 jjtree
.closeNodeScope(jjtn000
, true);
2467 {if (true) return new FilterSpec(cond
);}
2468 } catch (Throwable jjte000
) {
2470 jjtree
.clearNodeScope(jjtn000
);
2475 if (jjte000
instanceof RuntimeException
) {
2476 {if (true) throw (RuntimeException
)jjte000
;}
2478 if (jjte000
instanceof ParseException
) {
2479 {if (true) throw (ParseException
)jjte000
;}
2481 {if (true) throw (Error
)jjte000
;}
2484 jjtree
.closeNodeScope(jjtn000
, true);
2487 throw new Error("Missing return statement in function");
2490 final public EvalSpec
PSAD() throws ParseException
{
2491 /*@bgen(jjtree) PSAD */
2492 SimpleNode jjtn000
= new SimpleNode(JJTPSAD
);
2493 boolean jjtc000
= true;
2494 jjtree
.openNodeScope(jjtn000
);EvalSpec sad
; EvalItemList proj
;
2496 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2498 jj_consume_token(ORDER
);
2499 jj_consume_token(BY
);
2500 proj
= SimpleProj(null);
2501 sad
= new SortArrangeSpec(proj
, false);
2504 jj_consume_token(ARRANGE
);
2505 jj_consume_token(BY
);
2506 proj
= SimpleProj(null);
2507 sad
= new SortArrangeSpec(proj
, true);
2510 jj_consume_token(DISTINCT
);
2511 proj
= SimpleProj(null);
2512 sad
= new DistinctSpec(proj
);
2515 jj_la1
[58] = jj_gen
;
2516 jj_consume_token(-1);
2517 throw new ParseException();
2519 jjtree
.closeNodeScope(jjtn000
, true);
2521 {if (true) return sad
;}
2522 } catch (Throwable jjte000
) {
2524 jjtree
.clearNodeScope(jjtn000
);
2529 if (jjte000
instanceof RuntimeException
) {
2530 {if (true) throw (RuntimeException
)jjte000
;}
2532 if (jjte000
instanceof ParseException
) {
2533 {if (true) throw (ParseException
)jjte000
;}
2535 {if (true) throw (Error
)jjte000
;}
2538 jjtree
.closeNodeScope(jjtn000
, true);
2541 throw new Error("Missing return statement in function");
2544 final public EvalItemList
PEvalItemList() throws ParseException
{
2545 /*@bgen(jjtree) PEvalItemList */
2546 SimpleNode jjtn000
= new SimpleNode(JJTPEVALITEMLIST
);
2547 boolean jjtc000
= true;
2548 jjtree
.openNodeScope(jjtn000
);EvalItemList list
= new EvalItemList(pigContext
); EvalItem item
;
2554 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2559 jj_la1
[59] = jj_gen
;
2562 jj_consume_token(56);
2566 jjtree
.closeNodeScope(jjtn000
, true);
2568 {if (true) return list
;}
2569 } catch (Throwable jjte000
) {
2571 jjtree
.clearNodeScope(jjtn000
);
2576 if (jjte000
instanceof RuntimeException
) {
2577 {if (true) throw (RuntimeException
)jjte000
;}
2579 if (jjte000
instanceof ParseException
) {
2580 {if (true) throw (ParseException
)jjte000
;}
2582 {if (true) throw (Error
)jjte000
;}
2585 jjtree
.closeNodeScope(jjtn000
, true);
2588 throw new Error("Missing return statement in function");
2591 final public EvalItem
PEvalItem() throws ParseException
{
2592 /*@bgen(jjtree) PEvalItem */
2593 SimpleNode jjtn000
= new SimpleNode(JJTPEVALITEM
);
2594 boolean jjtc000
= true;
2595 jjtree
.openNodeScope(jjtn000
);EvalItem item
; EvalSpec subSpec
; EvalItemList subProj
; LogicalOperator subOp
= null;
2597 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2607 item
= PNestableEvalItem();
2610 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2615 jj_la1
[60] = jj_gen
;
2618 jj_consume_token(65);
2619 subSpec
= PEvalSpec();
2620 jj_consume_token(66);
2621 ((NestableEvalItem
) item
).addNestedEvalSpec(subSpec
);
2623 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2625 jj_consume_token(62);
2626 jj_consume_token(54);
2628 jj_consume_token(55);
2629 EvalItemList list
= new EvalItemList(pigContext
);
2630 list
.add(new StarEvalItem(pigContext
));
2631 ((NestableEvalItem
) item
).subColSpec
= list
;
2634 jj_la1
[61] = jj_gen
;
2639 jj_la1
[62] = jj_gen
;
2640 jj_consume_token(-1);
2641 throw new ParseException();
2643 jjtree
.closeNodeScope(jjtn000
, true);
2645 {if (true) return item
;}
2646 } catch (Throwable jjte000
) {
2648 jjtree
.clearNodeScope(jjtn000
);
2653 if (jjte000
instanceof RuntimeException
) {
2654 {if (true) throw (RuntimeException
)jjte000
;}
2656 if (jjte000
instanceof ParseException
) {
2657 {if (true) throw (ParseException
)jjte000
;}
2659 {if (true) throw (Error
)jjte000
;}
2662 jjtree
.closeNodeScope(jjtn000
, true);
2665 throw new Error("Missing return statement in function");
2668 final public NestableEvalItem
PNestableEvalItem() throws ParseException
{
2669 /*@bgen(jjtree) PNestableEvalItem */
2670 SimpleNode jjtn000
= new SimpleNode(JJTPNESTABLEEVALITEM
);
2671 boolean jjtc000
= true;
2672 jjtree
.openNodeScope(jjtn000
);NestableEvalItem item
;
2674 if (jj_2_13(2147483647)) {
2675 item
= EvalFunctionItem();
2676 } else if (jj_2_14(2147483647)) {
2678 } else if (jj_2_15(2147483647)) {
2679 item
= SerializedBinCond();
2681 jj_consume_token(-1);
2682 throw new ParseException();
2684 jjtree
.closeNodeScope(jjtn000
, true);
2686 {if (true) return item
;}
2687 } catch (Throwable jjte000
) {
2689 jjtree
.clearNodeScope(jjtn000
);
2694 if (jjte000
instanceof RuntimeException
) {
2695 {if (true) throw (RuntimeException
)jjte000
;}
2697 if (jjte000
instanceof ParseException
) {
2698 {if (true) throw (ParseException
)jjte000
;}
2700 {if (true) throw (Error
)jjte000
;}
2703 jjtree
.closeNodeScope(jjtn000
, true);
2706 throw new Error("Missing return statement in function");
2709 final public NestableEvalItem
EvalFunctionItem() throws ParseException
{
2710 /*@bgen(jjtree) EvalFunctionItem */
2711 SimpleNode jjtn000
= new SimpleNode(JJTEVALFUNCTIONITEM
);
2712 boolean jjtc000
= true;
2713 jjtree
.openNodeScope(jjtn000
);EvalFunc func
; EvalItemList args
; NestableEvalItem i
;
2715 func
= EvalFunction();
2716 jj_consume_token(54);
2717 args
= PEvalItemList();
2718 jj_consume_token(55);
2719 i
= newFuncEvalItem(func
, args
);
2720 jjtree
.closeNodeScope(jjtn000
, true);
2722 {if (true) return i
;}
2723 } catch (Throwable jjte000
) {
2725 jjtree
.clearNodeScope(jjtn000
);
2730 if (jjte000
instanceof RuntimeException
) {
2731 {if (true) throw (RuntimeException
)jjte000
;}
2733 if (jjte000
instanceof ParseException
) {
2734 {if (true) throw (ParseException
)jjte000
;}
2736 {if (true) throw (Error
)jjte000
;}
2739 jjtree
.closeNodeScope(jjtn000
, true);
2742 throw new Error("Missing return statement in function");
2745 final public NestableEvalItem
SerializedBinCond() throws ParseException
{
2746 /*@bgen(jjtree) SerializedBinCond */
2747 SimpleNode jjtn000
= new SimpleNode(JJTSERIALIZEDBINCOND
);
2748 boolean jjtc000
= true;
2749 jjtree
.openNodeScope(jjtn000
);Cond cond
; EvalItem ifTrue
, ifFalse
; NestableEvalItem ret
= null;
2751 jj_consume_token(54);
2752 cond
= PSerializedCond();
2753 jj_consume_token(63);
2754 ifTrue
= PEvalItem();
2755 jj_consume_token(64);
2756 ifFalse
= PEvalItem();
2757 jj_consume_token(55);
2758 jjtree
.closeNodeScope(jjtn000
, true);
2760 {if (true) return new BinCond(pigContext
, cond
,ifTrue
,ifFalse
);}
2761 } catch (Throwable jjte000
) {
2763 jjtree
.clearNodeScope(jjtn000
);
2768 if (jjte000
instanceof RuntimeException
) {
2769 {if (true) throw (RuntimeException
)jjte000
;}
2771 if (jjte000
instanceof ParseException
) {
2772 {if (true) throw (ParseException
)jjte000
;}
2774 {if (true) throw (Error
)jjte000
;}
2777 jjtree
.closeNodeScope(jjtn000
, true);
2780 throw new Error("Missing return statement in function");
2783 final public Cond
PSerializedCond() throws ParseException
{
2784 /*@bgen(jjtree) PSerializedCond */
2785 SimpleNode jjtn000
= new SimpleNode(JJTPSERIALIZEDCOND
);
2786 boolean jjtc000
= true;
2787 jjtree
.openNodeScope(jjtn000
);Cond cond
= null;
2789 cond
= PSerializedOrCond();
2790 jjtree
.closeNodeScope(jjtn000
, true);
2792 {if (true) return cond
;}
2793 } catch (Throwable jjte000
) {
2795 jjtree
.clearNodeScope(jjtn000
);
2800 if (jjte000
instanceof RuntimeException
) {
2801 {if (true) throw (RuntimeException
)jjte000
;}
2803 if (jjte000
instanceof ParseException
) {
2804 {if (true) throw (ParseException
)jjte000
;}
2806 {if (true) throw (Error
)jjte000
;}
2809 jjtree
.closeNodeScope(jjtn000
, true);
2812 throw new Error("Missing return statement in function");
2815 final public Cond
PSerializedOrCond() throws ParseException
{
2816 /*@bgen(jjtree) PSerializedOrCond */
2817 SimpleNode jjtn000
= new SimpleNode(JJTPSERIALIZEDORCOND
);
2818 boolean jjtc000
= true;
2819 jjtree
.openNodeScope(jjtn000
);Cond cond
; List
<Cond
> cList
= new ArrayList
<Cond
>();
2821 cond
= PSerializedAndCond();
2825 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2830 jj_la1
[63] = jj_gen
;
2833 jj_consume_token(OR
);
2834 cond
= PSerializedAndCond();
2837 jjtree
.closeNodeScope(jjtn000
, true);
2839 if (cList
.size()==1)
2840 {if (true) return cond
;}
2842 {if (true) return new OrCond(cList
);}
2843 } catch (Throwable jjte000
) {
2845 jjtree
.clearNodeScope(jjtn000
);
2850 if (jjte000
instanceof RuntimeException
) {
2851 {if (true) throw (RuntimeException
)jjte000
;}
2853 if (jjte000
instanceof ParseException
) {
2854 {if (true) throw (ParseException
)jjte000
;}
2856 {if (true) throw (Error
)jjte000
;}
2859 jjtree
.closeNodeScope(jjtn000
, true);
2862 throw new Error("Missing return statement in function");
2865 final public Cond
PSerializedAndCond() throws ParseException
{
2866 /*@bgen(jjtree) PSerializedAndCond */
2867 SimpleNode jjtn000
= new SimpleNode(JJTPSERIALIZEDANDCOND
);
2868 boolean jjtc000
= true;
2869 jjtree
.openNodeScope(jjtn000
);Cond cond
= null; List
<Cond
> cList
= new ArrayList
<Cond
>();
2871 cond
= PSerializedUnaryCond();
2875 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2880 jj_la1
[64] = jj_gen
;
2883 jj_consume_token(AND
);
2884 cond
= PSerializedUnaryCond();
2887 jjtree
.closeNodeScope(jjtn000
, true);
2889 if (cList
.size()==1)
2890 {if (true) return cond
;}
2892 {if (true) return new AndCond(cList
);}
2893 } catch (Throwable jjte000
) {
2895 jjtree
.clearNodeScope(jjtn000
);
2900 if (jjte000
instanceof RuntimeException
) {
2901 {if (true) throw (RuntimeException
)jjte000
;}
2903 if (jjte000
instanceof ParseException
) {
2904 {if (true) throw (ParseException
)jjte000
;}
2906 {if (true) throw (Error
)jjte000
;}
2909 jjtree
.closeNodeScope(jjtn000
, true);
2912 throw new Error("Missing return statement in function");
2915 final public Cond
PSerializedUnaryCond() throws ParseException
{
2916 /*@bgen(jjtree) PSerializedUnaryCond */
2917 SimpleNode jjtn000
= new SimpleNode(JJTPSERIALIZEDUNARYCOND
);
2918 boolean jjtc000
= true;
2919 jjtree
.openNodeScope(jjtn000
);Cond cond
= null; EvalItem c1
, c2
; Token t1
; FilterFunc func
; EvalItemList args
;
2921 if (jj_2_16(2147483647)) {
2922 jj_consume_token(54);
2923 cond
= PSerializedCond();
2924 jj_consume_token(55);
2926 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2928 cond
= PSerializedNotCond();
2931 jj_la1
[65] = jj_gen
;
2932 if (jj_2_17(2147483647)) {
2934 t1
= jj_consume_token(FILTEROP
);
2936 cond
= new CompCond(c1
, t1
.image
, c2
);
2937 } else if (jj_2_18(2147483647)) {
2939 jj_consume_token(MATCHES
);
2940 t1
= jj_consume_token(QUOTEDSTRING
);
2941 cond
= new RegexpCond(c1
, unquote(t1
.image
));
2943 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
2945 func
= FilterFunction();
2946 jj_consume_token(54);
2947 args
= PEvalItemList();
2948 jj_consume_token(55);
2949 cond
= new FuncCond(func
, args
);
2952 jj_la1
[66] = jj_gen
;
2953 jj_consume_token(-1);
2954 throw new ParseException();
2959 jjtree
.closeNodeScope(jjtn000
, true);
2961 {if (true) return cond
;}
2962 } catch (Throwable jjte000
) {
2964 jjtree
.clearNodeScope(jjtn000
);
2969 if (jjte000
instanceof RuntimeException
) {
2970 {if (true) throw (RuntimeException
)jjte000
;}
2972 if (jjte000
instanceof ParseException
) {
2973 {if (true) throw (ParseException
)jjte000
;}
2975 {if (true) throw (Error
)jjte000
;}
2978 jjtree
.closeNodeScope(jjtn000
, true);
2981 throw new Error("Missing return statement in function");
2984 final public Cond
PSerializedNotCond() throws ParseException
{
2985 /*@bgen(jjtree) PSerializedNotCond */
2986 SimpleNode jjtn000
= new SimpleNode(JJTPSERIALIZEDNOTCOND
);
2987 boolean jjtc000
= true;
2988 jjtree
.openNodeScope(jjtn000
);Cond c1
;
2990 jj_consume_token(NOT
);
2991 c1
= PSerializedUnaryCond();
2992 jjtree
.closeNodeScope(jjtn000
, true);
2994 {if (true) return new NotCond(c1
);}
2995 } catch (Throwable jjte000
) {
2997 jjtree
.clearNodeScope(jjtn000
);
3002 if (jjte000
instanceof RuntimeException
) {
3003 {if (true) throw (RuntimeException
)jjte000
;}
3005 if (jjte000
instanceof ParseException
) {
3006 {if (true) throw (ParseException
)jjte000
;}
3008 {if (true) throw (Error
)jjte000
;}
3011 jjtree
.closeNodeScope(jjtn000
, true);
3014 throw new Error("Missing return statement in function");
3018 final public EvalSpec
PWindow() throws ParseException
{
3019 /*@bgen(jjtree) PWindow */
3020 SimpleNode jjtn000
= new SimpleNode(JJTPWINDOW
);
3021 boolean jjtc000
= true;
3022 jjtree
.openNodeScope(jjtn000
);EvalSpec spec
; int numTuples
; double time
;
3024 jj_consume_token(WINDOW
);
3026 time
= PTimeWindow();
3027 spec
= new TimeWindowSpec(WindowSpec
.windowType
.SLIDING
, time
);
3029 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3031 numTuples
= PTupleWindow();
3032 spec
= new TupleWindowSpec(WindowSpec
.windowType
.SLIDING
, numTuples
);
3035 jj_la1
[67] = jj_gen
;
3036 jj_consume_token(-1);
3037 throw new ParseException();
3040 jjtree
.closeNodeScope(jjtn000
, true);
3042 {if (true) return spec
;}
3043 } catch (Throwable jjte000
) {
3045 jjtree
.clearNodeScope(jjtn000
);
3050 if (jjte000
instanceof RuntimeException
) {
3051 {if (true) throw (RuntimeException
)jjte000
;}
3053 if (jjte000
instanceof ParseException
) {
3054 {if (true) throw (ParseException
)jjte000
;}
3056 {if (true) throw (Error
)jjte000
;}
3059 jjtree
.closeNodeScope(jjtn000
, true);
3062 throw new Error("Missing return statement in function");
3065 final public double PTimeWindow() throws ParseException
{
3066 /*@bgen(jjtree) PTimeWindow */
3067 SimpleNode jjtn000
= new SimpleNode(JJTPTIMEWINDOW
);
3068 boolean jjtc000
= true;
3069 jjtree
.openNodeScope(jjtn000
);double n
; Token t
;
3071 t
= jj_consume_token(NUMBER
);
3072 n
= Double
.parseDouble(t
.image
);
3073 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3075 jj_consume_token(SECONDS
);
3078 jj_consume_token(MINUTES
);
3082 jj_consume_token(HOURS
);
3086 jj_la1
[68] = jj_gen
;
3087 jj_consume_token(-1);
3088 throw new ParseException();
3090 jjtree
.closeNodeScope(jjtn000
, true);
3092 {if (true) return n
;}
3095 jjtree
.closeNodeScope(jjtn000
, true);
3098 throw new Error("Missing return statement in function");
3101 final public int PTupleWindow() throws ParseException
{
3102 /*@bgen(jjtree) PTupleWindow */
3103 SimpleNode jjtn000
= new SimpleNode(JJTPTUPLEWINDOW
);
3104 boolean jjtc000
= true;
3105 jjtree
.openNodeScope(jjtn000
);int n
; Token t
;
3107 t
= jj_consume_token(NUMBER
);
3109 n
= Integer
.parseInt(t
.image
);
3110 }catch(NumberFormatException e
){
3111 {if (true) throw new ParseException("Only whole number tuple windows allowed.");}
3113 jj_consume_token(TUPLES
);
3114 jjtree
.closeNodeScope(jjtn000
, true);
3116 {if (true) return n
;}
3119 jjtree
.closeNodeScope(jjtn000
, true);
3122 throw new Error("Missing return statement in function");
3125 // These the simple non-terminals that are shared across many
3126 final public EvalFunc
EvalFunction() throws ParseException
{
3127 /*@bgen(jjtree) EvalFunction */
3128 SimpleNode jjtn000
= new SimpleNode(JJTEVALFUNCTION
);
3129 boolean jjtc000
= true;
3130 jjtree
.openNodeScope(jjtn000
);String funcName
;
3132 funcName
= QualifiedFunction();
3133 jjtree
.closeNodeScope(jjtn000
, true);
3135 {if (true) return (EvalFunc
) pigContext
.getUDF(funcName
);}
3136 } catch (Throwable jjte000
) {
3138 jjtree
.clearNodeScope(jjtn000
);
3143 if (jjte000
instanceof RuntimeException
) {
3144 {if (true) throw (RuntimeException
)jjte000
;}
3146 if (jjte000
instanceof ParseException
) {
3147 {if (true) throw (ParseException
)jjte000
;}
3149 {if (true) throw (Error
)jjte000
;}
3152 jjtree
.closeNodeScope(jjtn000
, true);
3155 throw new Error("Missing return statement in function");
3158 final public GroupFunc
GroupFunction() throws ParseException
{
3159 /*@bgen(jjtree) GroupFunction */
3160 SimpleNode jjtn000
= new SimpleNode(JJTGROUPFUNCTION
);
3161 boolean jjtc000
= true;
3162 jjtree
.openNodeScope(jjtn000
);String funcName
;
3164 funcName
= QualifiedFunction();
3165 jjtree
.closeNodeScope(jjtn000
, true);
3167 {if (true) return (GroupFunc
) pigContext
.getUDF(funcName
);}
3168 } catch (Throwable jjte000
) {
3170 jjtree
.clearNodeScope(jjtn000
);
3175 if (jjte000
instanceof RuntimeException
) {
3176 {if (true) throw (RuntimeException
)jjte000
;}
3178 if (jjte000
instanceof ParseException
) {
3179 {if (true) throw (ParseException
)jjte000
;}
3181 {if (true) throw (Error
)jjte000
;}
3184 jjtree
.closeNodeScope(jjtn000
, true);
3187 throw new Error("Missing return statement in function");
3190 final public StorageFunc
LoadFunction() throws ParseException
{
3191 /*@bgen(jjtree) LoadFunction */
3192 SimpleNode jjtn000
= new SimpleNode(JJTLOADFUNCTION
);
3193 boolean jjtc000
= true;
3194 jjtree
.openNodeScope(jjtn000
);String funcName
;
3196 funcName
= QualifiedFunction();
3197 jjtree
.closeNodeScope(jjtn000
, true);
3199 {if (true) return (StorageFunc
) pigContext
.getUDF(funcName
);}
3200 } catch (Throwable jjte000
) {
3202 jjtree
.clearNodeScope(jjtn000
);
3207 if (jjte000
instanceof RuntimeException
) {
3208 {if (true) throw (RuntimeException
)jjte000
;}
3210 if (jjte000
instanceof ParseException
) {
3211 {if (true) throw (ParseException
)jjte000
;}
3213 {if (true) throw (Error
)jjte000
;}
3216 jjtree
.closeNodeScope(jjtn000
, true);
3219 throw new Error("Missing return statement in function");
3222 final public FilterFunc
FilterFunction() throws ParseException
{
3223 /*@bgen(jjtree) FilterFunction */
3224 SimpleNode jjtn000
= new SimpleNode(JJTFILTERFUNCTION
);
3225 boolean jjtc000
= true;
3226 jjtree
.openNodeScope(jjtn000
);String funcName
;
3228 funcName
= QualifiedFunction();
3229 jjtree
.closeNodeScope(jjtn000
, true);
3231 {if (true) return (FilterFunc
) pigContext
.getUDF(funcName
);}
3232 } catch (Throwable jjte000
) {
3234 jjtree
.clearNodeScope(jjtn000
);
3239 if (jjte000
instanceof RuntimeException
) {
3240 {if (true) throw (RuntimeException
)jjte000
;}
3242 if (jjte000
instanceof ParseException
) {
3243 {if (true) throw (ParseException
)jjte000
;}
3245 {if (true) throw (Error
)jjte000
;}
3248 jjtree
.closeNodeScope(jjtn000
, true);
3251 throw new Error("Missing return statement in function");
3255 * Bug 831620 - '$' support
3257 final public void ClassName() throws ParseException
{
3258 jj_consume_token(IDENTIFIER
);
3261 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3267 jj_la1
[69] = jj_gen
;
3270 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3272 jj_consume_token(62);
3273 jj_consume_token(IDENTIFIER
);
3276 jj_consume_token(67);
3277 jj_consume_token(IDENTIFIER
);
3280 jj_la1
[70] = jj_gen
;
3281 jj_consume_token(-1);
3282 throw new ParseException();
3288 * Bug 831620 - '$' support
3290 final public String
QualifiedFunction() throws ParseException
{
3291 Token t1
;StringBuffer s
=new StringBuffer();
3292 t1
= jj_consume_token(IDENTIFIER
);
3296 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3302 jj_la1
[71] = jj_gen
;
3305 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3307 jj_consume_token(62);
3308 t1
= jj_consume_token(IDENTIFIER
);
3309 s
.append("." + t1
.image
);
3312 jj_consume_token(67);
3313 t1
= jj_consume_token(IDENTIFIER
);
3314 s
.append("$" + t1
.image
);
3317 jj_la1
[72] = jj_gen
;
3318 jj_consume_token(-1);
3319 throw new ParseException();
3322 {if (true) return s
.toString();}
3323 throw new Error("Missing return statement in function");
3326 // If there is one time it may not be bracketed, but if multiple, they must be bracketed
3327 final public EvalItemList
BracketedSimpleProj(SchemaItem over
) throws ParseException
{
3328 /*@bgen(jjtree) BracketedSimpleProj */
3329 SimpleNode jjtn000
= new SimpleNode(JJTBRACKETEDSIMPLEPROJ
);
3330 boolean jjtc000
= true;
3331 jjtree
.openNodeScope(jjtn000
);EvalItem i
= null; EvalItemList proj
= new EvalItemList(pigContext
);
3333 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3339 i
= PSimpleProjItem(over
);
3343 jj_consume_token(54);
3344 i
= PSimpleProjItem(over
);
3348 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3353 jj_la1
[73] = jj_gen
;
3356 jj_consume_token(56);
3357 i
= PSimpleProjItem(over
);
3360 jj_consume_token(55);
3363 jj_la1
[74] = jj_gen
;
3364 jj_consume_token(-1);
3365 throw new ParseException();
3367 jjtree
.closeNodeScope(jjtn000
, true);
3369 {if (true) return proj
;}
3370 } catch (Throwable jjte000
) {
3372 jjtree
.clearNodeScope(jjtn000
);
3377 if (jjte000
instanceof RuntimeException
) {
3378 {if (true) throw (RuntimeException
)jjte000
;}
3380 if (jjte000
instanceof ParseException
) {
3381 {if (true) throw (ParseException
)jjte000
;}
3383 {if (true) throw (Error
)jjte000
;}
3386 jjtree
.closeNodeScope(jjtn000
, true);
3389 throw new Error("Missing return statement in function");
3392 final public EvalItemList
SimpleProjOrEmpty(SchemaItem over
) throws ParseException
{
3393 /*@bgen(jjtree) SimpleProjOrEmpty */
3394 SimpleNode jjtn000
= new SimpleNode(JJTSIMPLEPROJOREMPTY
);
3395 boolean jjtc000
= true;
3396 jjtree
.openNodeScope(jjtn000
);EvalItemList list
;
3398 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3404 list
= SimpleProj(over
);
3407 jj_la1
[75] = jj_gen
;
3408 list
= new EvalItemList(pigContext
);
3410 jjtree
.closeNodeScope(jjtn000
, true);
3412 {if (true) return list
;}
3413 } catch (Throwable jjte000
) {
3415 jjtree
.clearNodeScope(jjtn000
);
3420 if (jjte000
instanceof RuntimeException
) {
3421 {if (true) throw (RuntimeException
)jjte000
;}
3423 if (jjte000
instanceof ParseException
) {
3424 {if (true) throw (ParseException
)jjte000
;}
3426 {if (true) throw (Error
)jjte000
;}
3429 jjtree
.closeNodeScope(jjtn000
, true);
3432 throw new Error("Missing return statement in function");
3435 //Just a simple list of projection items
3436 final public EvalItemList
SimpleProj(SchemaItem over
) throws ParseException
{
3437 /*@bgen(jjtree) SimpleProj */
3438 SimpleNode jjtn000
= new SimpleNode(JJTSIMPLEPROJ
);
3439 boolean jjtc000
= true;
3440 jjtree
.openNodeScope(jjtn000
);EvalItem i
= null; EvalItemList proj
= new EvalItemList(pigContext
);
3442 i
= PSimpleProjItem(over
);
3446 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3451 jj_la1
[76] = jj_gen
;
3454 jj_consume_token(56);
3455 i
= PSimpleProjItem(over
);
3458 jjtree
.closeNodeScope(jjtn000
, true);
3460 {if (true) return proj
;}
3461 } catch (Throwable jjte000
) {
3463 jjtree
.clearNodeScope(jjtn000
);
3468 if (jjte000
instanceof RuntimeException
) {
3469 {if (true) throw (RuntimeException
)jjte000
;}
3471 if (jjte000
instanceof ParseException
) {
3472 {if (true) throw (ParseException
)jjte000
;}
3474 {if (true) throw (Error
)jjte000
;}
3477 jjtree
.closeNodeScope(jjtn000
, true);
3480 throw new Error("Missing return statement in function");
3483 final public EvalItem
PSimpleProjItem(SchemaItem over
) throws ParseException
{
3484 /*@bgen(jjtree) PSimpleProjItem */
3485 SimpleNode jjtn000
= new SimpleNode(JJTPSIMPLEPROJITEM
);
3486 boolean jjtc000
= true;
3487 jjtree
.openNodeScope(jjtn000
);EvalItem item
;
3489 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3496 item
= PColEvalItem(over
,null);
3502 jj_la1
[77] = jj_gen
;
3503 jj_consume_token(-1);
3504 throw new ParseException();
3506 jjtree
.closeNodeScope(jjtn000
, true);
3508 {if (true) return item
;}
3509 } catch (Throwable jjte000
) {
3511 jjtree
.clearNodeScope(jjtn000
);
3516 if (jjte000
instanceof RuntimeException
) {
3517 {if (true) throw (RuntimeException
)jjte000
;}
3519 if (jjte000
instanceof ParseException
) {
3520 {if (true) throw (ParseException
)jjte000
;}
3522 {if (true) throw (Error
)jjte000
;}
3525 jjtree
.closeNodeScope(jjtn000
, true);
3528 throw new Error("Missing return statement in function");
3531 final public EvalItem
Star() throws ParseException
{
3532 /*@bgen(jjtree) Star */
3533 SimpleNode jjtn000
= new SimpleNode(JJTSTAR
);
3534 boolean jjtc000
= true;
3535 jjtree
.openNodeScope(jjtn000
);Token t1
;
3537 t1
= jj_consume_token(STAR
);
3538 jjtree
.closeNodeScope(jjtn000
, true);
3540 {if (true) return new StarEvalItem(pigContext
);}
3543 jjtree
.closeNodeScope(jjtn000
, true);
3546 throw new Error("Missing return statement in function");
3549 final public EvalItem
Const() throws ParseException
{
3550 /*@bgen(jjtree) Const */
3551 SimpleNode jjtn000
= new SimpleNode(JJTCONST
);
3552 boolean jjtc000
= true;
3553 jjtree
.openNodeScope(jjtn000
);Token t1
;
3555 t1
= jj_consume_token(QUOTEDSTRING
);
3556 jjtree
.closeNodeScope(jjtn000
, true);
3558 {if (true) return new ConstEvalItem(pigContext
, unquote(t1
.image
));}
3561 jjtree
.closeNodeScope(jjtn000
, true);
3564 throw new Error("Missing return statement in function");
3567 final public EvalItem
PColEvalItem(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
3568 /*@bgen(jjtree) PColEvalItem */
3569 SimpleNode jjtn000
= new SimpleNode(JJTPCOLEVALITEM
);
3570 boolean jjtc000
= true;
3571 jjtree
.openNodeScope(jjtn000
);EvalItem item
;
3573 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3579 item
= AliasField(over
, pipes
);
3582 jj_la1
[78] = jj_gen
;
3583 jj_consume_token(-1);
3584 throw new ParseException();
3586 jjtree
.closeNodeScope(jjtn000
, true);
3588 {if (true) return item
;}
3589 } catch (Throwable jjte000
) {
3591 jjtree
.clearNodeScope(jjtn000
);
3596 if (jjte000
instanceof RuntimeException
) {
3597 {if (true) throw (RuntimeException
)jjte000
;}
3599 if (jjte000
instanceof ParseException
) {
3600 {if (true) throw (ParseException
)jjte000
;}
3602 {if (true) throw (Error
)jjte000
;}
3605 jjtree
.closeNodeScope(jjtn000
, true);
3608 throw new Error("Missing return statement in function");
3611 final public ColEvalItem
DollarVar() throws ParseException
{
3612 /*@bgen(jjtree) DollarVar */
3613 SimpleNode jjtn000
= new SimpleNode(JJTDOLLARVAR
);
3614 boolean jjtc000
= true;
3615 jjtree
.openNodeScope(jjtn000
);Token t1
;
3617 t1
= jj_consume_token(DOLLARVAR
);
3618 jjtree
.closeNodeScope(jjtn000
, true);
3620 {if (true) return new ColEvalItem(pigContext
, undollar(t1
.image
));}
3623 jjtree
.closeNodeScope(jjtn000
, true);
3626 throw new Error("Missing return statement in function");
3629 final public EvalItem
AliasField(SchemaItem over
, Map
<String
, EvalItem
> pipes
) throws ParseException
{
3630 /*@bgen(jjtree) AliasField */
3631 SimpleNode jjtn000
= new SimpleNode(JJTALIASFIELD
);
3632 boolean jjtc000
= true;
3633 jjtree
.openNodeScope(jjtn000
);Token t1
;
3635 switch ((jj_ntk
==-1)?
jj_ntk():jj_ntk
) {
3637 t1
= jj_consume_token(GROUP
);
3640 t1
= jj_consume_token(IDENTIFIER
);
3643 jj_la1
[79] = jj_gen
;
3644 jj_consume_token(-1);
3645 throw new ParseException();
3647 jjtree
.closeNodeScope(jjtn000
, true);
3649 int i
; EvalItem item
= null;
3651 item
= pipes
.get(t1
.image
);
3654 if ( over
== null || (i
= over
.colFor(t1
.image
)) == -1)
3655 {if (true) throw new ParseException("Invalid alias: " + t1
.image
+ " in " + over
.alias
+ "--> " + over
);}
3656 item
= new ColEvalItem(pigContext
, i
);
3658 {if (true) return item
;}
3661 jjtree
.closeNodeScope(jjtn000
, true);
3664 throw new Error("Missing return statement in function");
3667 final private boolean jj_2_1(int xla
) {
3668 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3669 try { return !jj_3_1(); }
3670 catch(LookaheadSuccess ls
) { return true; }
3671 finally { jj_save(0, xla
); }
3674 final private boolean jj_2_2(int xla
) {
3675 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3676 try { return !jj_3_2(); }
3677 catch(LookaheadSuccess ls
) { return true; }
3678 finally { jj_save(1, xla
); }
3681 final private boolean jj_2_3(int xla
) {
3682 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3683 try { return !jj_3_3(); }
3684 catch(LookaheadSuccess ls
) { return true; }
3685 finally { jj_save(2, xla
); }
3688 final private boolean jj_2_4(int xla
) {
3689 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3690 try { return !jj_3_4(); }
3691 catch(LookaheadSuccess ls
) { return true; }
3692 finally { jj_save(3, xla
); }
3695 final private boolean jj_2_5(int xla
) {
3696 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3697 try { return !jj_3_5(); }
3698 catch(LookaheadSuccess ls
) { return true; }
3699 finally { jj_save(4, xla
); }
3702 final private boolean jj_2_6(int xla
) {
3703 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3704 try { return !jj_3_6(); }
3705 catch(LookaheadSuccess ls
) { return true; }
3706 finally { jj_save(5, xla
); }
3709 final private boolean jj_2_7(int xla
) {
3710 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3711 try { return !jj_3_7(); }
3712 catch(LookaheadSuccess ls
) { return true; }
3713 finally { jj_save(6, xla
); }
3716 final private boolean jj_2_8(int xla
) {
3717 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3718 try { return !jj_3_8(); }
3719 catch(LookaheadSuccess ls
) { return true; }
3720 finally { jj_save(7, xla
); }
3723 final private boolean jj_2_9(int xla
) {
3724 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3725 try { return !jj_3_9(); }
3726 catch(LookaheadSuccess ls
) { return true; }
3727 finally { jj_save(8, xla
); }
3730 final private boolean jj_2_10(int xla
) {
3731 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3732 try { return !jj_3_10(); }
3733 catch(LookaheadSuccess ls
) { return true; }
3734 finally { jj_save(9, xla
); }
3737 final private boolean jj_2_11(int xla
) {
3738 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3739 try { return !jj_3_11(); }
3740 catch(LookaheadSuccess ls
) { return true; }
3741 finally { jj_save(10, xla
); }
3744 final private boolean jj_2_12(int xla
) {
3745 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3746 try { return !jj_3_12(); }
3747 catch(LookaheadSuccess ls
) { return true; }
3748 finally { jj_save(11, xla
); }
3751 final private boolean jj_2_13(int xla
) {
3752 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3753 try { return !jj_3_13(); }
3754 catch(LookaheadSuccess ls
) { return true; }
3755 finally { jj_save(12, xla
); }
3758 final private boolean jj_2_14(int xla
) {
3759 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3760 try { return !jj_3_14(); }
3761 catch(LookaheadSuccess ls
) { return true; }
3762 finally { jj_save(13, xla
); }
3765 final private boolean jj_2_15(int xla
) {
3766 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3767 try { return !jj_3_15(); }
3768 catch(LookaheadSuccess ls
) { return true; }
3769 finally { jj_save(14, xla
); }
3772 final private boolean jj_2_16(int xla
) {
3773 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3774 try { return !jj_3_16(); }
3775 catch(LookaheadSuccess ls
) { return true; }
3776 finally { jj_save(15, xla
); }
3779 final private boolean jj_2_17(int xla
) {
3780 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3781 try { return !jj_3_17(); }
3782 catch(LookaheadSuccess ls
) { return true; }
3783 finally { jj_save(16, xla
); }
3786 final private boolean jj_2_18(int xla
) {
3787 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3788 try { return !jj_3_18(); }
3789 catch(LookaheadSuccess ls
) { return true; }
3790 finally { jj_save(17, xla
); }
3793 final private boolean jj_2_19(int xla
) {
3794 jj_la
= xla
; jj_lastpos
= jj_scanpos
= token
;
3795 try { return !jj_3_19(); }
3796 catch(LookaheadSuccess ls
) { return true; }
3797 finally { jj_save(18, xla
); }
3800 final private boolean jj_3R_63() {
3801 if (jj_3R_85()) return true;
3805 if (jj_3R_86()) { jj_scanpos
= xsp
; break; }
3810 final private boolean jj_3R_121() {
3811 if (jj_3R_26()) return true;
3812 if (jj_scan_token(54)) return true;
3813 if (jj_3R_55()) return true;
3814 if (jj_scan_token(55)) return true;
3818 final private boolean jj_3R_120() {
3819 if (jj_3R_38()) return true;
3820 if (jj_scan_token(MATCHES
)) return true;
3821 if (jj_scan_token(QUOTEDSTRING
)) return true;
3825 final private boolean jj_3R_119() {
3826 if (jj_3R_38()) return true;
3827 if (jj_scan_token(FILTEROP
)) return true;
3828 if (jj_3R_38()) return true;
3832 final private boolean jj_3R_118() {
3833 if (jj_3R_129()) return true;
3837 final private boolean jj_3R_117() {
3838 if (jj_scan_token(54)) return true;
3839 if (jj_3R_37()) return true;
3840 if (jj_scan_token(55)) return true;
3844 final private boolean jj_3R_99() {
3855 if (jj_3R_121()) return true;
3863 final private boolean jj_3R_64() {
3864 if (jj_scan_token(OR
)) return true;
3865 if (jj_3R_63()) return true;
3869 final private boolean jj_3R_126() {
3872 if (jj_scan_token(29)) {
3874 if (jj_scan_token(46)) return true;
3879 final private boolean jj_3R_42() {
3880 if (jj_3R_63()) return true;
3884 if (jj_3R_64()) { jj_scanpos
= xsp
; break; }
3889 final private boolean jj_3R_100() {
3890 if (jj_scan_token(AND
)) return true;
3891 if (jj_3R_99()) return true;
3895 final private boolean jj_3R_25() {
3896 if (jj_3R_42()) return true;
3900 final private boolean jj_3R_35() {
3901 if (jj_scan_token(DOLLARVAR
)) return true;
3905 final private boolean jj_3R_79() {
3906 if (jj_3R_99()) return true;
3910 if (jj_3R_100()) { jj_scanpos
= xsp
; break; }
3915 final private boolean jj_3R_116() {
3916 if (jj_3R_81()) return true;
3920 final private boolean jj_3R_112() {
3921 if (jj_3R_126()) return true;
3925 final private boolean jj_3R_115() {
3926 if (jj_3R_27()) return true;
3930 final private boolean jj_3R_111() {
3931 if (jj_3R_35()) return true;
3935 final private boolean jj_3R_94() {
3940 if (jj_3R_116()) return true;
3945 final private boolean jj_3R_91() {
3950 if (jj_3R_112()) return true;
3955 final private boolean jj_3R_80() {
3956 if (jj_scan_token(OR
)) return true;
3957 if (jj_3R_79()) return true;
3961 final private boolean jj_3R_56() {
3962 if (jj_3R_79()) return true;
3966 if (jj_3R_80()) { jj_scanpos
= xsp
; break; }
3971 final private boolean jj_3R_68() {
3972 if (jj_scan_token(QUOTEDSTRING
)) return true;
3976 final private boolean jj_3R_74() {
3980 final private boolean jj_3R_37() {
3981 if (jj_3R_56()) return true;
3985 final private boolean jj_3R_95() {
3986 if (jj_scan_token(56)) return true;
3987 if (jj_3R_94()) return true;
3991 final private boolean jj_3R_81() {
3992 if (jj_scan_token(STAR
)) return true;
3996 final private boolean jj_3R_73() {
3997 if (jj_3R_94()) return true;
4001 if (jj_3R_95()) { jj_scanpos
= xsp
; break; }
4006 final private boolean jj_3R_48() {
4011 if (jj_3R_74()) return true;
4016 final private boolean jj_3R_134() {
4017 if (jj_3R_81()) return true;
4021 final private boolean jj_3R_133() {
4022 if (jj_3R_91()) return true;
4026 final private boolean jj_3R_30() {
4027 if (jj_3R_47()) return true;
4028 if (jj_scan_token(54)) return true;
4029 if (jj_3R_48()) return true;
4030 if (jj_scan_token(55)) return true;
4034 final private boolean jj_3R_139() {
4035 if (jj_scan_token(56)) return true;
4036 if (jj_3R_127()) return true;
4040 final private boolean jj_3R_132() {
4041 if (jj_3R_68()) return true;
4045 final private boolean jj_3R_127() {
4052 if (jj_3R_134()) return true;
4058 final private boolean jj_3R_36() {
4059 if (jj_scan_token(54)) return true;
4060 if (jj_3R_37()) return true;
4061 if (jj_scan_token(63)) return true;
4062 if (jj_3R_38()) return true;
4063 if (jj_scan_token(64)) return true;
4064 if (jj_3R_38()) return true;
4065 if (jj_scan_token(55)) return true;
4069 final private boolean jj_3_15() {
4070 if (jj_3R_36()) return true;
4074 final private boolean jj_3_13() {
4075 if (jj_3R_34()) return true;
4079 final private boolean jj_3_14() {
4080 if (jj_3R_35()) return true;
4084 final private boolean jj_3R_92() {
4085 if (jj_scan_token(54)) return true;
4086 if (jj_3R_25()) return true;
4087 if (jj_scan_token(63)) return true;
4088 if (jj_3R_29()) return true;
4089 if (jj_scan_token(64)) return true;
4090 if (jj_3R_29()) return true;
4091 if (jj_scan_token(55)) return true;
4095 final private boolean jj_3R_72() {
4096 if (jj_scan_token(62)) return true;
4097 if (jj_3R_93()) return true;
4101 final private boolean jj_3R_34() {
4102 if (jj_3R_47()) return true;
4103 if (jj_scan_token(54)) return true;
4104 if (jj_3R_55()) return true;
4105 if (jj_scan_token(55)) return true;
4109 final private boolean jj_3R_138() {
4110 if (jj_3R_127()) return true;
4114 if (jj_3R_139()) { jj_scanpos
= xsp
; break; }
4119 final private boolean jj_3R_124() {
4120 if (jj_3R_131()) return true;
4124 final private boolean jj_3_9() {
4125 if (jj_3R_30()) return true;
4129 final private boolean jj_3R_103() {
4130 if (jj_3R_36()) return true;
4134 final private boolean jj_3R_102() {
4135 if (jj_3R_35()) return true;
4139 final private boolean jj_3R_101() {
4140 if (jj_3R_34()) return true;
4144 final private boolean jj_3R_82() {
4151 if (jj_3R_103()) return true;
4157 final private boolean jj_3R_128() {
4158 if (jj_scan_token(56)) return true;
4159 if (jj_3R_127()) return true;
4163 final private boolean jj_3R_71() {
4164 if (jj_3R_92()) return true;
4168 final private boolean jj_3R_70() {
4169 if (jj_3R_91()) return true;
4173 final private boolean jj_3R_69() {
4174 if (jj_3R_30()) return true;
4178 final private boolean jj_3R_84() {
4179 if (jj_scan_token(62)) return true;
4180 if (jj_scan_token(54)) return true;
4181 if (jj_3R_81()) return true;
4182 if (jj_scan_token(55)) return true;
4186 final private boolean jj_3R_114() {
4187 if (jj_scan_token(54)) return true;
4188 if (jj_3R_127()) return true;
4192 if (jj_3R_128()) { jj_scanpos
= xsp
; break; }
4194 if (jj_scan_token(55)) return true;
4198 final private boolean jj_3R_62() {
4199 if (jj_scan_token(IDENTIFIER
)) return true;
4203 final private boolean jj_3R_113() {
4204 if (jj_3R_127()) return true;
4208 final private boolean jj_3R_93() {
4213 if (jj_3R_114()) return true;
4218 final private boolean jj_3R_83() {
4219 if (jj_scan_token(65)) return true;
4220 if (jj_3R_104()) return true;
4221 if (jj_scan_token(66)) return true;
4225 final private boolean jj_3R_46() {
4232 if (jj_3R_71()) return true;
4236 if (jj_3R_72()) jj_scanpos
= xsp
;
4240 final private boolean jj_3R_45() {
4241 if (jj_3R_68()) return true;
4245 final private boolean jj_3R_29() {
4250 if (jj_3R_46()) return true;
4255 final private boolean jj_3_8() {
4256 if (jj_3R_29()) return true;
4260 final private boolean jj_3R_59() {
4261 if (jj_3R_82()) return true;
4265 if (jj_3R_83()) { jj_scanpos
= xsp
; break; }
4268 if (jj_3R_84()) jj_scanpos
= xsp
;
4272 final private boolean jj_3R_88() {
4273 if (jj_scan_token(67)) return true;
4274 if (jj_scan_token(IDENTIFIER
)) return true;
4278 final private boolean jj_3R_41() {
4279 if (jj_scan_token(54)) return true;
4283 final private boolean jj_3R_58() {
4284 if (jj_3R_81()) return true;
4288 final private boolean jj_3R_87() {
4289 if (jj_scan_token(62)) return true;
4290 if (jj_scan_token(IDENTIFIER
)) return true;
4294 final private boolean jj_3_2() {
4295 if (jj_scan_token(54)) return true;
4296 if (jj_3R_24()) return true;
4300 final private boolean jj_3R_57() {
4301 if (jj_3R_68()) return true;
4305 final private boolean jj_3R_65() {
4310 if (jj_3R_88()) return true;
4315 final private boolean jj_3R_40() {
4316 if (jj_3R_62()) return true;
4320 final private boolean jj_3R_38() {
4327 if (jj_3R_59()) return true;
4333 final private boolean jj_3R_123() {
4334 if (jj_scan_token(EVAL
)) return true;
4335 if (jj_3R_55()) return true;
4339 final private boolean jj_3R_24() {
4346 if (jj_3R_41()) return true;
4352 final private boolean jj_3R_43() {
4353 if (jj_scan_token(IDENTIFIER
)) return true;
4357 if (jj_3R_65()) { jj_scanpos
= xsp
; break; }
4362 final private boolean jj_3R_110() {
4363 if (jj_scan_token(54)) return true;
4364 if (jj_3R_27()) return true;
4365 if (jj_scan_token(55)) return true;
4369 final private boolean jj_3R_78() {
4370 if (jj_scan_token(56)) return true;
4371 if (jj_3R_38()) return true;
4375 final private boolean jj_3R_109() {
4376 if (jj_3R_29()) return true;
4380 final private boolean jj_3R_89() {
4385 if (jj_3R_110()) return true;
4390 final private boolean jj_3R_55() {
4391 if (jj_3R_38()) return true;
4395 if (jj_3R_78()) { jj_scanpos
= xsp
; break; }
4400 final private boolean jj_3R_137() {
4401 if (jj_scan_token(DISTINCT
)) return true;
4402 if (jj_3R_138()) return true;
4406 final private boolean jj_3R_136() {
4407 if (jj_scan_token(ARRANGE
)) return true;
4408 if (jj_scan_token(BY
)) return true;
4409 if (jj_3R_138()) return true;
4413 final private boolean jj_3R_135() {
4414 if (jj_scan_token(ORDER
)) return true;
4415 if (jj_scan_token(BY
)) return true;
4416 if (jj_3R_138()) return true;
4420 final private boolean jj_3R_131() {
4427 if (jj_3R_137()) return true;
4433 final private boolean jj_3R_26() {
4434 if (jj_3R_43()) return true;
4438 final private boolean jj_3R_90() {
4441 if (jj_scan_token(27)) {
4443 if (jj_scan_token(61)) return true;
4445 if (jj_3R_89()) return true;
4449 final private boolean jj_3_1() {
4450 if (jj_scan_token(IDENTIFIER
)) return true;
4451 if (jj_scan_token(52)) return true;
4455 final private boolean jj_3R_130() {
4456 if (jj_3R_25()) return true;
4460 final private boolean jj_3R_66() {
4461 if (jj_3R_89()) return true;
4465 if (jj_3R_90()) { jj_scanpos
= xsp
; break; }
4470 final private boolean jj_3R_122() {
4471 if (jj_scan_token(FILTER
)) return true;
4472 if (jj_3R_130()) return true;
4476 final private boolean jj_3R_104() {
4483 if (jj_3R_124()) return true;
4489 final private boolean jj_3R_28() {
4490 if (jj_3R_43()) return true;
4494 final private boolean jj_3R_47() {
4495 if (jj_3R_43()) return true;
4499 final private boolean jj_3_7() {
4500 if (jj_3R_28()) return true;
4501 if (jj_scan_token(54)) return true;
4505 final private boolean jj_3R_67() {
4508 if (jj_scan_token(59)) {
4510 if (jj_scan_token(60)) return true;
4512 if (jj_3R_66()) return true;
4516 final private boolean jj_3R_76() {
4517 if (jj_scan_token(56)) return true;
4518 if (jj_3R_75()) return true;
4522 final private boolean jj_3R_61() {
4523 if (jj_scan_token(HOURS
)) return true;
4527 final private boolean jj_3R_44() {
4528 if (jj_3R_66()) return true;
4532 if (jj_3R_67()) { jj_scanpos
= xsp
; break; }
4537 final private boolean jj_3R_60() {
4538 if (jj_scan_token(MINUTES
)) return true;
4542 final private boolean jj_3R_51() {
4546 final private boolean jj_3R_49() {
4547 if (jj_scan_token(IDENTIFIER
)) return true;
4548 if (jj_scan_token(64)) return true;
4552 final private boolean jj_3R_50() {
4553 if (jj_3R_75()) return true;
4557 if (jj_3R_76()) { jj_scanpos
= xsp
; break; }
4562 final private boolean jj_3R_27() {
4563 if (jj_3R_44()) return true;
4567 final private boolean jj_3R_31() {
4570 if (jj_3R_49()) jj_scanpos
= xsp
;
4571 if (jj_scan_token(65)) return true;
4575 if (jj_3R_51()) return true;
4577 if (jj_scan_token(66)) return true;
4581 final private boolean jj_3R_39() {
4582 if (jj_scan_token(NUMBER
)) return true;
4585 if (jj_scan_token(35)) {
4589 if (jj_3R_61()) return true;
4595 final private boolean jj_3_19() {
4596 if (jj_3R_39()) return true;
4600 final private boolean jj_3R_77() {
4601 if (jj_scan_token(56)) return true;
4602 if (jj_3R_75()) return true;
4606 final private boolean jj_3R_54() {
4610 final private boolean jj_3R_125() {
4611 if (jj_scan_token(NOT
)) return true;
4612 if (jj_3R_85()) return true;
4616 final private boolean jj_3_5() {
4617 if (jj_3R_27()) return true;
4618 if (jj_scan_token(FILTEROP
)) return true;
4622 final private boolean jj_3_4() {
4623 if (jj_3R_26()) return true;
4624 if (jj_scan_token(54)) return true;
4628 final private boolean jj_3_3() {
4629 if (jj_scan_token(54)) return true;
4630 if (jj_3R_25()) return true;
4631 if (jj_scan_token(55)) return true;
4635 final private boolean jj_3_6() {
4636 if (jj_3R_27()) return true;
4637 if (jj_scan_token(MATCHES
)) return true;
4638 if (jj_scan_token(QUOTEDSTRING
)) return true;
4642 final private boolean jj_3R_108() {
4643 if (jj_3R_27()) return true;
4644 if (jj_scan_token(FILTEROP
)) return true;
4645 if (jj_3R_27()) return true;
4649 final private boolean jj_3R_53() {
4650 if (jj_3R_75()) return true;
4654 if (jj_3R_77()) { jj_scanpos
= xsp
; break; }
4659 final private boolean jj_3R_107() {
4660 if (jj_3R_125()) return true;
4664 final private boolean jj_3R_52() {
4667 if (jj_scan_token(46)) {
4669 if (jj_scan_token(29)) return true;
4671 if (jj_scan_token(64)) return true;
4675 final private boolean jj_3R_106() {
4676 if (jj_3R_26()) return true;
4677 if (jj_scan_token(54)) return true;
4678 if (jj_3R_48()) return true;
4679 if (jj_scan_token(55)) return true;
4683 final private boolean jj_3R_32() {
4686 if (jj_3R_52()) jj_scanpos
= xsp
;
4687 if (jj_scan_token(54)) return true;
4691 if (jj_3R_54()) return true;
4693 if (jj_scan_token(55)) return true;
4697 final private boolean jj_3R_105() {
4698 if (jj_scan_token(54)) return true;
4699 if (jj_3R_25()) return true;
4700 if (jj_scan_token(55)) return true;
4704 final private boolean jj_3_11() {
4705 if (jj_3R_32()) return true;
4709 final private boolean jj_3R_85() {
4720 if (jj_3_6()) return true;
4728 final private boolean jj_3_10() {
4729 if (jj_3R_31()) return true;
4733 final private boolean jj_3_12() {
4734 if (jj_3R_33()) return true;
4738 final private boolean jj_3R_33() {
4741 if (jj_scan_token(46)) {
4743 if (jj_scan_token(29)) return true;
4748 final private boolean jj_3_18() {
4749 if (jj_3R_38()) return true;
4750 if (jj_scan_token(MATCHES
)) return true;
4754 final private boolean jj_3R_129() {
4755 if (jj_scan_token(NOT
)) return true;
4756 if (jj_3R_99()) return true;
4760 final private boolean jj_3R_97() {
4761 if (jj_3R_32()) return true;
4765 final private boolean jj_3_17() {
4766 if (jj_3R_38()) return true;
4767 if (jj_scan_token(FILTEROP
)) return true;
4771 final private boolean jj_3R_96() {
4772 if (jj_3R_31()) return true;
4776 final private boolean jj_3R_86() {
4777 if (jj_scan_token(AND
)) return true;
4778 if (jj_3R_85()) return true;
4782 final private boolean jj_3R_75() {
4789 if (jj_3R_98()) return true;
4795 final private boolean jj_3R_98() {
4796 if (jj_3R_33()) return true;
4800 final private boolean jj_3_16() {
4801 if (jj_scan_token(54)) return true;
4802 if (jj_3R_37()) return true;
4803 if (jj_scan_token(55)) return true;
4807 public QueryParserTokenManager token_source
;
4808 SimpleCharStream jj_input_stream
;
4809 public Token token
, jj_nt
;
4811 private Token jj_scanpos
, jj_lastpos
;
4813 public boolean lookingAhead
= false;
4814 private boolean jj_semLA
;
4816 final private int[] jj_la1
= new int[80];
4817 static private int[] jj_la1_0
;
4818 static private int[] jj_la1_1
;
4819 static private int[] jj_la1_2
;
4825 private static void jj_la1_0() {
4826 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,};
4828 private static void jj_la1_1() {
4829 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,};
4831 private static void jj_la1_2() {
4832 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,};
4834 final private JJCalls
[] jj_2_rtns
= new JJCalls
[19];
4835 private boolean jj_rescan
= false;
4836 private int jj_gc
= 0;
4838 public QueryParser(java
.io
.InputStream stream
) {
4841 public QueryParser(java
.io
.InputStream stream
, String encoding
) {
4842 try { jj_input_stream
= new SimpleCharStream(stream
, encoding
, 1, 1); } catch(java
.io
.UnsupportedEncodingException e
) { throw new RuntimeException(e
); }
4843 token_source
= new QueryParserTokenManager(jj_input_stream
);
4844 token
= new Token();
4847 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4848 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4851 public void ReInit(java
.io
.InputStream stream
) {
4852 ReInit(stream
, null);
4854 public void ReInit(java
.io
.InputStream stream
, String encoding
) {
4855 try { jj_input_stream
.ReInit(stream
, encoding
, 1, 1); } catch(java
.io
.UnsupportedEncodingException e
) { throw new RuntimeException(e
); }
4856 token_source
.ReInit(jj_input_stream
);
4857 token
= new Token();
4861 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4862 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4865 public QueryParser(java
.io
.Reader stream
) {
4866 jj_input_stream
= new SimpleCharStream(stream
, 1, 1);
4867 token_source
= new QueryParserTokenManager(jj_input_stream
);
4868 token
= new Token();
4871 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4872 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4875 public void ReInit(java
.io
.Reader stream
) {
4876 jj_input_stream
.ReInit(stream
, 1, 1);
4877 token_source
.ReInit(jj_input_stream
);
4878 token
= new Token();
4882 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4883 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4886 public QueryParser(QueryParserTokenManager tm
) {
4888 token
= new Token();
4891 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4892 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4895 public void ReInit(QueryParserTokenManager tm
) {
4897 token
= new Token();
4901 for (int i
= 0; i
< 80; i
++) jj_la1
[i
] = -1;
4902 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) jj_2_rtns
[i
] = new JJCalls();
4905 final private Token
jj_consume_token(int kind
) throws ParseException
{
4907 if ((oldToken
= token
).next
!= null) token
= token
.next
;
4908 else token
= token
.next
= token_source
.getNextToken();
4910 if (token
.kind
== kind
) {
4912 if (++jj_gc
> 100) {
4914 for (int i
= 0; i
< jj_2_rtns
.length
; i
++) {
4915 JJCalls c
= jj_2_rtns
[i
];
4917 if (c
.gen
< jj_gen
) c
.first
= null;
4926 throw generateParseException();
4929 static private final class LookaheadSuccess
extends java
.lang
.Error
{ }
4930 final private LookaheadSuccess jj_ls
= new LookaheadSuccess();
4931 final private boolean jj_scan_token(int kind
) {
4932 if (jj_scanpos
== jj_lastpos
) {
4934 if (jj_scanpos
.next
== null) {
4935 jj_lastpos
= jj_scanpos
= jj_scanpos
.next
= token_source
.getNextToken();
4937 jj_lastpos
= jj_scanpos
= jj_scanpos
.next
;
4940 jj_scanpos
= jj_scanpos
.next
;
4943 int i
= 0; Token tok
= token
;
4944 while (tok
!= null && tok
!= jj_scanpos
) { i
++; tok
= tok
.next
; }
4945 if (tok
!= null) jj_add_error_token(kind
, i
);
4947 if (jj_scanpos
.kind
!= kind
) return true;
4948 if (jj_la
== 0 && jj_scanpos
== jj_lastpos
) throw jj_ls
;
4952 final public Token
getNextToken() {
4953 if (token
.next
!= null) token
= token
.next
;
4954 else token
= token
.next
= token_source
.getNextToken();
4960 final public Token
getToken(int index
) {
4961 Token t
= lookingAhead ? jj_scanpos
: token
;
4962 for (int i
= 0; i
< index
; i
++) {
4963 if (t
.next
!= null) t
= t
.next
;
4964 else t
= t
.next
= token_source
.getNextToken();
4969 final private int jj_ntk() {
4970 if ((jj_nt
=token
.next
) == null)
4971 return (jj_ntk
= (token
.next
=token_source
.getNextToken()).kind
);
4973 return (jj_ntk
= jj_nt
.kind
);
4976 private java
.util
.Vector jj_expentries
= new java
.util
.Vector();
4977 private int[] jj_expentry
;
4978 private int jj_kind
= -1;
4979 private int[] jj_lasttokens
= new int[100];
4980 private int jj_endpos
;
4982 private void jj_add_error_token(int kind
, int pos
) {
4983 if (pos
>= 100) return;
4984 if (pos
== jj_endpos
+ 1) {
4985 jj_lasttokens
[jj_endpos
++] = kind
;
4986 } else if (jj_endpos
!= 0) {
4987 jj_expentry
= new int[jj_endpos
];
4988 for (int i
= 0; i
< jj_endpos
; i
++) {
4989 jj_expentry
[i
] = jj_lasttokens
[i
];
4991 boolean exists
= false;
4992 for (java
.util
.Enumeration e
= jj_expentries
.elements(); e
.hasMoreElements();) {
4993 int[] oldentry
= (int[])(e
.nextElement());
4994 if (oldentry
.length
== jj_expentry
.length
) {
4996 for (int i
= 0; i
< jj_expentry
.length
; i
++) {
4997 if (oldentry
[i
] != jj_expentry
[i
]) {
5005 if (!exists
) jj_expentries
.addElement(jj_expentry
);
5006 if (pos
!= 0) jj_lasttokens
[(jj_endpos
= pos
) - 1] = kind
;
5010 public ParseException
generateParseException() {
5011 jj_expentries
.removeAllElements();
5012 boolean[] la1tokens
= new boolean[68];
5013 for (int i
= 0; i
< 68; i
++) {
5014 la1tokens
[i
] = false;
5017 la1tokens
[jj_kind
] = true;
5020 for (int i
= 0; i
< 80; i
++) {
5021 if (jj_la1
[i
] == jj_gen
) {
5022 for (int j
= 0; j
< 32; j
++) {
5023 if ((jj_la1_0
[i
] & (1<<j
)) != 0) {
5024 la1tokens
[j
] = true;
5026 if ((jj_la1_1
[i
] & (1<<j
)) != 0) {
5027 la1tokens
[32+j
] = true;
5029 if ((jj_la1_2
[i
] & (1<<j
)) != 0) {
5030 la1tokens
[64+j
] = true;
5035 for (int i
= 0; i
< 68; i
++) {
5037 jj_expentry
= new int[1];
5039 jj_expentries
.addElement(jj_expentry
);
5044 jj_add_error_token(0, 0);
5045 int[][] exptokseq
= new int[jj_expentries
.size()][];
5046 for (int i
= 0; i
< jj_expentries
.size(); i
++) {
5047 exptokseq
[i
] = (int[])jj_expentries
.elementAt(i
);
5049 return new ParseException(token
, exptokseq
, tokenImage
);
5052 final public void enable_tracing() {
5055 final public void disable_tracing() {
5058 final private void jj_rescan_token() {
5060 for (int i
= 0; i
< 19; i
++) {
5062 JJCalls p
= jj_2_rtns
[i
];
5064 if (p
.gen
> jj_gen
) {
5065 jj_la
= p
.arg
; jj_lastpos
= jj_scanpos
= p
.first
;
5067 case 0: jj_3_1(); break;
5068 case 1: jj_3_2(); break;
5069 case 2: jj_3_3(); break;
5070 case 3: jj_3_4(); break;
5071 case 4: jj_3_5(); break;
5072 case 5: jj_3_6(); break;
5073 case 6: jj_3_7(); break;
5074 case 7: jj_3_8(); break;
5075 case 8: jj_3_9(); break;
5076 case 9: jj_3_10(); break;
5077 case 10: jj_3_11(); break;
5078 case 11: jj_3_12(); break;
5079 case 12: jj_3_13(); break;
5080 case 13: jj_3_14(); break;
5081 case 14: jj_3_15(); break;
5082 case 15: jj_3_16(); break;
5083 case 16: jj_3_17(); break;
5084 case 17: jj_3_18(); break;
5085 case 18: jj_3_19(); break;
5089 } while (p
!= null);
5090 } catch(LookaheadSuccess ls
) { }
5095 final private void jj_save(int index
, int xla
) {
5096 JJCalls p
= jj_2_rtns
[index
];
5097 while (p
.gen
> jj_gen
) {
5098 if (p
.next
== null) { p
= p
.next
= new JJCalls(); break; }
5101 p
.gen
= jj_gen
+ xla
- jj_la
; p
.first
= token
; p
.arg
= xla
;
5104 static final class JJCalls
{