NewArrayValueReader is to create ArrayValueReader to read from upsertbatch, which includes the item number
(dataType DataType, value unsafe.Pointer)
| 715 | |
| 716 | // NewArrayValueReader is to create ArrayValueReader to read from upsertbatch, which includes the item number |
| 717 | func NewArrayValueReader(dataType DataType, value unsafe.Pointer) *ArrayValueReader { |
| 718 | length := *((*uint32)(value)) |
| 719 | return &ArrayValueReader{ |
| 720 | itemType: GetElementDataType(dataType), |
| 721 | value: unsafe.Pointer(uintptr(value) + 4), |
| 722 | length: int(length), |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | // GetLength return item numbers inside the array |
| 727 | func (reader *ArrayValueReader) GetLength() int { |