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

Method exec

src/org/apache/pig/builtin/BuildBloom.java:124–145  ·  view source on GitHub ↗
(Tuple input)

Source from the content-addressed store, hash-verified

122 }
123
124 @Override
125 public Tuple exec(Tuple input) throws IOException {
126 if (input == null || input.size() == 0) return null;
127
128 // Strip off the initial level of bag
129 DataBag values = (DataBag)input.get(0);
130 Iterator<Tuple> it = values.iterator();
131 Tuple t = it.next();
132
133 // If the input tuple has only one field, then we'll extract
134 // that field and serialize it into a key. If it has multiple
135 // fields, we'll serialize the whole tuple.
136 byte[] b;
137 if (t.size() == 1) b = DataType.toBytes(t.get(0));
138 else b = DataType.toBytes(t, DataType.TUPLE);
139
140 Key k = new Key(b);
141 filter = new BloomFilter(vSize, numHash, hType);
142 filter.add(k);
143
144 return TupleFactory.getInstance().newTuple(bloomOut());
145 }
146 }
147
148 static public class Intermediate extends BuildBloomBase<Tuple> {

Callers

nothing calls this directly

Calls 9

sizeMethod · 0.95
getMethod · 0.95
iteratorMethod · 0.95
toBytesMethod · 0.95
getInstanceMethod · 0.95
bloomOutMethod · 0.80
addMethod · 0.65
newTupleMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected