Skip to content

hard cloning should check offset === 0 #21

Description

@kylebarron

I.e. in this example if you look at

table.getChildAt(0)

you'll see

Vector [IntVector<Int>] {
  _offsets: Uint32Array(4) [ 0, 1, 2, 3 ],
  data: [
    Data {
      type: [Int32 [Int]],
      children: [],
      dictionary: undefined,
      offset: 0,
      length: 1,
      _nullCount: 0,
      stride: 1,
      values: [Int32Array],
      nullBitmap: Uint8Array(0) []
    },
    Data {
      type: [Int32 [Int]],
      children: [],
      dictionary: undefined,
      offset: 1,
      length: 1,
      _nullCount: 0,
      stride: 1,
      values: [Int32Array],
      nullBitmap: Uint8Array(0) []
    },
    Data {
      type: [Int32 [Int]],
      children: [],
      dictionary: undefined,
      offset: 0,
      length: 1,
      _nullCount: 0,
      stride: 1,
      values: [Int32Array],
      nullBitmap: Uint8Array(0) []
    }
  ],
  type: Int32 [Int] { isSigned: true, bitWidth: 32 },
  stride: 1,
  numChildren: 0,
  length: 3
}

So the second Data is a zero copy slice on the input. This means that if you checked if it's shared, it would say it's not shared because the view occupies the whole buffer? Need to double check this.

In any case, implementing hard cloning with slicing shouldn't be too hard, copying from the arrowjs method that has subarrays

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions