Beispiel #1
0
        public override void setElement(int outElementNum, int inputElementNum,
                                        ColumnVector inputVector)
        {
            ListColumnVector input = (ListColumnVector)inputVector;

            if (input.isRepeating)
            {
                inputElementNum = 0;
            }
            if (!input.noNulls && input.isNull[inputElementNum])
            {
                isNull[outElementNum] = true;
                noNulls = false;
            }
            else
            {
                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;
                child.ensureSize(childCount, true);
                for (int i = 0; i < length; ++i)
                {
                    child.setElement(i + offset, inputOffset + i, input.child);
                }
            }
        }
 private static void setInnerList(ListColumnVector list, int rowId, List<InnerStruct> value)
 {
     if (value != null)
     {
         if (list.childCount + value.Count > list.child.isNull.Length)
         {
             list.child.ensureSize(list.childCount * 2, true);
         }
         list.lengths[rowId] = value.Count;
         list.offsets[rowId] = list.childCount;
         for (int i = 0; i < list.lengths[rowId]; ++i)
         {
             InnerStruct inner = value[i];
             setInner((StructColumnVector)list.child, i + list.childCount,
                 inner.int1, inner.string1.ToString());
         }
         list.childCount += value.Count;
     }
     else
     {
         list.isNull[rowId] = true;
         list.noNulls = false;
     }
 }