MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / merge

Method merge

src/java/simpledb/storage/TupleDesc.java:205–212  ·  view source on GitHub ↗

Merge two TupleDescs into one, with td1.numFields + td2.numFields fields, with the first td1.numFields coming from td1 and the remaining from td2. @param td1 The TupleDesc with the first fields of the new TupleDesc @param td2 The TupleDesc with the last fields of the TupleDesc

(TupleDesc td1, TupleDesc td2)

Source from the content-addressed store, hash-verified

203 * @return the new TupleDesc
204 */
205 public static TupleDesc merge(TupleDesc td1, TupleDesc td2) {
206 // some code goes here
207 List<TDItem> tupleDescList01 = td1.tupleDescList;
208 List<TDItem> tupleDescList02 = td2.tupleDescList;
209 List<TDItem> res = new ArrayList<>(tupleDescList01);
210 res.addAll(tupleDescList02);
211 return new TupleDesc(res);
212 }
213
214 /**
215 * 比较type

Callers 3

combineMethod · 0.95
JoinMethod · 0.95
HashEquiJoinMethod · 0.95

Calls

no outgoing calls

Tested by 1

combineMethod · 0.76