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

Method testPigStatsAlias

test/org/apache/pig/test/TestPigStats.java:147–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145 abstract public void checkPigStatsAlias(PhysicalPlan pp, PigContext pc) throws Exception;
146
147 @Test
148 public void testPigStatsAlias() throws Exception {
149 try {
150 PigServer pig = new PigServer(Util.getLocalTestMode());
151 pig.setBatchOn();
152 pig.registerQuery("A = load 'input' as (name, age, gpa);");
153 pig.registerQuery("B = group A by name;");
154 pig.registerQuery("C = foreach B generate group, COUNT(A);");
155 pig.registerQuery("D = order C by $1;");
156 pig.registerQuery("E = limit D 10;");
157 pig.registerQuery("store E into 'alias_output';");
158
159 LogicalPlan lp = getLogicalPlan(pig);
160 lp.optimize(pig.getPigContext());
161 PhysicalPlan pp = ((HExecutionEngine)pig.getPigContext().getExecutionEngine()).compile(lp,
162 null);
163 checkPigStatsAlias(pp, pig.getPigContext());
164 } finally {
165 File outputfile = new File("alias_output");
166 if (outputfile.exists()) {
167 // Hadoop Local mode creates a directory
168 // Hence we need to delete a directory recursively
169 deleteDirectory(outputfile);
170 }
171 }
172 }
173
174 abstract public void checkPigStats(ExecJob job);
175

Callers

nothing calls this directly

Calls 11

getLocalTestModeMethod · 0.95
setBatchOnMethod · 0.95
registerQueryMethod · 0.95
getLogicalPlanMethod · 0.95
optimizeMethod · 0.95
getPigContextMethod · 0.95
checkPigStatsAliasMethod · 0.95
deleteDirectoryMethod · 0.95
getExecutionEngineMethod · 0.65
existsMethod · 0.65
compileMethod · 0.45

Tested by

no test coverage detected