()
| 142 | } |
| 143 | |
| 144 | @Test |
| 145 | public void testDistinct() throws Exception { |
| 146 | System.out.println("Running testDistinct..."); |
| 147 | pig.registerQuery("A = load " + fileName + ";"); |
| 148 | pig.registerQuery("B = distinct A;"); |
| 149 | |
| 150 | Iterator <Tuple> B = pig.openIterator("B"); |
| 151 | |
| 152 | Integer[] COUNT_Test = new Integer[max_rand]; |
| 153 | Integer[] COUNT_Data = new Integer[max_rand]; |
| 154 | |
| 155 | for(int i = 0; i < max_rand; i++) { |
| 156 | COUNT_Test[i] = 0; |
| 157 | if (COUNT[i] > 0) { |
| 158 | COUNT_Data[i] = 1; |
| 159 | } else { |
| 160 | COUNT_Data[i] = 0; |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | while(B.hasNext()) { |
| 165 | int temp = DataType.toInteger(B.next().get(0)); |
| 166 | COUNT_Test[temp] ++; |
| 167 | } |
| 168 | |
| 169 | for(int i = 0; i < max_rand; i++) { |
| 170 | assertEquals(COUNT_Test[i].intValue(), COUNT_Data[i].intValue()); |
| 171 | } |
| 172 | } |
| 173 | } |
nothing calls this directly
no test coverage detected