MCPcopy Create free account
hub / github.com/apache/pig / main

Method main

tutorial/src/org/apache/pig/tutorial/TutorialTest.java:96–169  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

94 }
95
96 public static void main(String[] args) {
97 String[] queries = {
98 "http://www.yahoo.com/",
99 "\"http://www.yahoo.com/\"",
100 " http;//www.yahoo.com/ ",
101 "https://www.yahoo.com/",
102 "www.yahoo.com/",
103 "\"www.yahoo.com/\"",
104 "a real nice query ",
105 "an UPPER CASE query",
106 " ",
107 " nude picture",
108 " +XXX",
109 "\" +porno \"",
110 };
111
112 NonURLDetector filter1 = new NonURLDetector();
113 String[] q1 = testFilters(filter1, getTuples(queries));
114
115 ToLower eval1 = new ToLower();
116 String[] q2 = testDataAtomEvals(eval1, getTuples(q1));
117
118 String[] timestamps = {
119 "970916072134",
120 "970916072311",
121 "970916123431",
122 };
123
124 ExtractHour eval2 = new ExtractHour();
125 testDataAtomEvals(eval2, getTuples(timestamps));
126
127 DataBag bag = DefaultBagFactory.getInstance().newDefaultBag();
128
129 Tuple t1 = TupleFactory.getInstance().newTuple(3);
130 try{
131 t1.set(0, "word");
132 t1.set(1, "02");
133 t1.set(2, 2);
134 }catch(Exception e){}
135 bag.add(t1);
136
137 Tuple t2 = TupleFactory.getInstance().newTuple(3);
138 try{
139 t2.set(0, "word");
140 t2.set(1, "05");
141 t2.set(2, 2);
142 }catch(Exception e){}
143 bag.add(t2);
144
145 Tuple t3 = TupleFactory.getInstance().newTuple(3);
146 try{
147 t3.set(0, "word");
148 t3.set(1, "04");
149 t3.set(2, 3);
150 }catch(Exception e){}
151 bag.add(t3);
152
153 Tuple t4 = TupleFactory.getInstance().newTuple(3);

Callers

nothing calls this directly

Calls 10

testFiltersMethod · 0.95
getTuplesMethod · 0.95
testDataAtomEvalsMethod · 0.95
getInstanceMethod · 0.95
setMethod · 0.95
addMethod · 0.95
testDataBagEvalsMethod · 0.95
newTupleMethod · 0.65
newDefaultBagMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected