Verify that IN operator works with FILTER BY. @throws Exception
()
| 38 | * @throws Exception |
| 39 | */ |
| 40 | @Test |
| 41 | public void testWithFilter() throws Exception { |
| 42 | PigServer pigServer = new PigServer(Util.getLocalTestMode()); |
| 43 | Data data = resetData(pigServer); |
| 44 | |
| 45 | data.set("foo", |
| 46 | tuple(1), |
| 47 | tuple(2), |
| 48 | tuple(3), |
| 49 | tuple(4), |
| 50 | tuple(5) |
| 51 | ); |
| 52 | |
| 53 | pigServer.registerQuery("A = LOAD 'foo' USING mock.Storage() AS (i:int);"); |
| 54 | pigServer.registerQuery("B = FILTER A BY i IN (1, 2, 3);"); |
| 55 | pigServer.registerQuery("STORE B INTO 'bar' USING mock.Storage();"); |
| 56 | |
| 57 | List<Tuple> out = data.get("bar"); |
| 58 | assertEquals(3, out.size()); |
| 59 | assertEquals(tuple(1), out.get(0)); |
| 60 | assertEquals(tuple(2), out.get(1)); |
| 61 | assertEquals(tuple(3), out.get(2)); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Verify that IN operator works with ? operator. |
nothing calls this directly
no test coverage detected