public override void setElement(int outElementNum, int inputElementNum, ColumnVector inputVector) { if (inputVector.isRepeating) { inputElementNum = 0; } if (!inputVector.noNulls && inputVector.isNull[inputElementNum]) { isNull[outElementNum] = true; noNulls = false; } else { MapColumnVector input = (MapColumnVector)inputVector; isNull[outElementNum] = false; int offset = childCount; int length = (int)input.lengths[inputElementNum]; int inputOffset = (int)input.offsets[inputElementNum]; offsets[outElementNum] = offset; childCount += length; lengths[outElementNum] = length; keys.ensureSize(childCount, true); values.ensureSize(childCount, true); for (int i = 0; i < length; ++i) { keys.setElement(i + offset, inputOffset + i, input.keys); values.setElement(i + offset, inputOffset + i, input.values); } } }
private static void setInnerMap(MapColumnVector map, int rowId, Dictionary<string, InnerStruct> value) { if (value != null) { if (map.childCount >= map.keys.isNull.Length) { map.keys.ensureSize(map.childCount * 2, true); map.values.ensureSize(map.childCount * 2, true); } map.lengths[rowId] = value.Count; int offset = map.childCount; map.offsets[rowId] = offset; foreach (KeyValuePair<string, InnerStruct> entry in value) { ((BytesColumnVector)map.keys).setVal(offset, entry.Key.getBytes()); InnerStruct inner = entry.Value; setInner((StructColumnVector)map.values, offset, inner.int1, inner.string1.ToString()); offset += 1; } map.childCount = offset; } else { map.isNull[rowId] = true; map.noNulls = false; } }