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)
| 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 |
no outgoing calls