()
| 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 |
nothing calls this directly
no test coverage detected