()
| 99 | } |
| 100 | |
| 101 | @Test |
| 102 | public void test1() throws Exception { |
| 103 | String query = |
| 104 | "A = load '"+Util.encodeEscape(inputFile1.getAbsolutePath()) +"' " + |
| 105 | "using PigStorage(' ') as (a:int, b: " + |
| 106 | "{t:(t1:int,t2:int,t3:int,t4:int,c:chararray)});" + |
| 107 | "C = foreach A {" + |
| 108 | " temp1 = foreach b generate t1*100 as (key:int), ((t2+t3)*10) as (r:int);" + |
| 109 | " temp2 = filter temp1 by key < 400;" + |
| 110 | " temp3 = limit temp2 3;" + |
| 111 | " temp4 = foreach temp3 generate key-r as (id:int);" + |
| 112 | " temp5 = limit temp4 4;" + |
| 113 | " temp6 = filter temp5 by id < 100;" + |
| 114 | " generate flatten(temp6) as (id:int), a;" + |
| 115 | "};" + |
| 116 | "D = foreach C generate (" + |
| 117 | " case id % 4" + |
| 118 | " when 0 then true" + |
| 119 | " else false" + |
| 120 | " end" + |
| 121 | ") as (check:boolean);"; |
| 122 | |
| 123 | LogicalPlan lp = ParserTestingUtils.generateLogicalPlan(query); |
| 124 | |
| 125 | PhysicalPlan pp = ((HExecutionEngine) pigServer.getPigContext().getExecutionEngine()) |
| 126 | .compile(lp, null); |
| 127 | |
| 128 | boolean planFetchable = FetchOptimizer.isPlanFetchable(pigServer.getPigContext(), pp); |
| 129 | //plan is not fetchable since limit is not pushed up to the loader |
| 130 | assertFalse(planFetchable); |
| 131 | |
| 132 | } |
| 133 | |
| 134 | @Test |
| 135 | public void test2() throws Exception { |
nothing calls this directly
no test coverage detected