Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hard cloning should check offset === 0 #21

Open
kylebarron opened this issue Dec 6, 2023 · 0 comments
Open

hard cloning should check offset === 0 #21

kylebarron opened this issue Dec 6, 2023 · 0 comments

Comments

@kylebarron
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant