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

Method setUpHashTable

test/org/apache/pig/test/TestFRJoin.java:117–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 }
116
117 private void setUpHashTable() throws IOException {
118 FileSpec replFile = new FileSpec(repl, new FuncSpec(PigStorage.class.getName() + "()"));
119 POLoad ld = new POLoad(new OperatorKey("Repl File Loader", 1L), replFile);
120 PigContext pc = new PigContext(ExecType.MAPREDUCE, PigMapReduce.sJobConfInternal.get());
121 pc.connect();
122
123 ld.setPc(pc);
124 for (Result res = ld.getNextTuple(); res.returnStatus != POStatus.STATUS_EOP; res = ld
125 .getNextTuple()) {
126 Tuple tup = (Tuple)res.result;
127 LoadFunc lf = ((LoadFunc)PigContext.instantiateFuncFromSpec(ld.getLFile().getFuncSpec()));
128 String key = lf.getLoadCaster().bytesToCharArray(
129 ((DataByteArray)tup.get(keyField)).get());
130 Tuple csttup = TupleFactory.getInstance().newTuple(2);
131 csttup.set(0, key);
132 csttup.set(1, lf.getLoadCaster().bytesToInteger(((DataByteArray)tup.get(1)).get()));
133 DataBag vals = null;
134 if (replTbl.containsKey(key)) {
135 vals = replTbl.get(key);
136 }
137 else {
138 vals = BagFactory.getInstance().newDefaultBag();
139 replTbl.put(key, vals);
140 }
141 vals.add(csttup);
142 }
143 }
144
145 }
146

Callers 1

execMethod · 0.95

Calls 15

getMethod · 0.95
connectMethod · 0.95
setPcMethod · 0.95
getNextTupleMethod · 0.95
getLFileMethod · 0.95
getLoadCasterMethod · 0.95
getInstanceMethod · 0.95
setMethod · 0.95
getInstanceMethod · 0.95
addMethod · 0.95
bytesToCharArrayMethod · 0.65

Tested by

no test coverage detected