()
| 132 | } |
| 133 | |
| 134 | @Test |
| 135 | public void test2() throws Exception { |
| 136 | Properties properties = pigServer.getPigContext().getProperties(); |
| 137 | properties.setProperty(PigConfiguration.PIG_TEMP_FILE_COMPRESSION_CODEC, "gz"); |
| 138 | properties.setProperty(PigConfiguration.PIG_ENABLE_TEMP_FILE_COMPRESSION, "true"); |
| 139 | properties.setProperty(PigConfiguration.PIG_TEMP_FILE_COMPRESSION_STORAGE, "tfile"); |
| 140 | |
| 141 | String query = |
| 142 | "A = load '"+Util.encodeEscape(inputFile1.getAbsolutePath()) +"' " + |
| 143 | "using PigStorage(' ') as (a:int, b: " + |
| 144 | "{t:(t1:int,t2:int,t3:int,t4:int,c:chararray)});" + |
| 145 | "C = foreach A {" + |
| 146 | " temp1 = foreach b generate t1*100 as (key:int), ((t2+t3)*10) as (r:int);" + |
| 147 | " temp2 = filter temp1 by key < 400;" + |
| 148 | " temp3 = limit temp2 3;" + |
| 149 | " temp4 = foreach temp3 generate key-r as (id:int);" + |
| 150 | " temp5 = limit temp4 4;" + |
| 151 | " temp6 = filter temp5 by id < 100;" + |
| 152 | " generate flatten(temp6) as (id:int), a;" + |
| 153 | "};" + |
| 154 | "D = foreach C generate (" + |
| 155 | " case id % 4" + |
| 156 | " when 0 then true" + |
| 157 | " else false" + |
| 158 | " end" + |
| 159 | ") as (check:boolean);" + |
| 160 | "store D into 'out' using org.apache.pig.impl.io.TFileStorage();"; |
| 161 | |
| 162 | LogicalPlan lp = ParserTestingUtils.generateLogicalPlan(query); |
| 163 | |
| 164 | PhysicalPlan pp = ((HExecutionEngine) pigServer.getPigContext().getExecutionEngine()) |
| 165 | .compile(lp, null); |
| 166 | |
| 167 | boolean planFetchable = FetchOptimizer.isPlanFetchable(pigServer.getPigContext(), pp); |
| 168 | assertFalse(planFetchable); |
| 169 | |
| 170 | } |
| 171 | |
| 172 | @Test |
| 173 | public void test3() throws Exception { |
nothing calls this directly
no test coverage detected