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

Method testUDFReturnMap_MapReduceMode

test/org/apache/pig/test/TestUDF.java:91–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 @Test
92 public void testUDFReturnMap_MapReduceMode() throws Exception {
93 Util.createInputFile(cluster, "a.txt", new String[] { "dummy",
94 "dummy" });
95 FileLocalizer.deleteTempFiles();
96 PigServer pig = new PigServer(cluster.getExecType(), cluster
97 .getProperties());
98 pig.registerQuery("A = LOAD 'a.txt';");
99 pig.registerQuery("B = FOREACH A GENERATE org.apache.pig.test.utils.MyUDFReturnMap();");
100
101 Iterator<Tuple> iterator = pig.openIterator("B");
102 while (iterator.hasNext()) {
103 Tuple tuple = iterator.next();
104 @SuppressWarnings("unchecked")
105 Map<Object, Object> result = (Map<Object, Object>) tuple.get(0);
106 assertEquals(result, MyUDFReturnMap.map);
107 }
108 }
109
110 @Test
111 public void testUDFMultiLevelOutputSchema() throws Exception {

Callers

nothing calls this directly

Calls 10

createInputFileMethod · 0.95
deleteTempFilesMethod · 0.95
registerQueryMethod · 0.95
openIteratorMethod · 0.95
getMethod · 0.95
getExecTypeMethod · 0.45
getPropertiesMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected