MCPcopy Create free account
hub / github.com/apache/pig / testWithFilter

Method testWithFilter

test/org/apache/pig/test/TestIn.java:40–62  ·  view source on GitHub ↗

Verify that IN operator works with FILTER BY. @throws Exception

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 9

getLocalTestModeMethod · 0.95
setMethod · 0.95
registerQueryMethod · 0.95
getMethod · 0.95
resetDataMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65
tupleMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected