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

Improve ArrowWriter performance for fixed-length vectors #888

Open
mbutrovich opened this issue Aug 29, 2024 · 0 comments
Open

Improve ArrowWriter performance for fixed-length vectors #888

mbutrovich opened this issue Aug 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mbutrovich
Copy link
Contributor

mbutrovich commented Aug 29, 2024

What is the problem the feature request solves?

Writing to Arrow vectors through Comet's ArrowWriter class only uses setSafe on the underlying vectors. This incurs a capacity and resize check for every write. For CometSparkToColumnarExec we know the sizes ahead of time, so this is unnecessary overhead when performing a lot of writes.

Describe the potential solution

For ArrowWriter we should:

  1. Expose a way to set the capacities for column vectors. Note that setInitialCapacity on the underlying BaseFixedWidthVector doesn't actually allocate anything, so we may need to call allocateNew as well.
  2. Extend ArrowWriter to have unsafe methods that call set on the underlying vectors, probably with assertions that we can elide in release builds.

Additional context

No response

@mbutrovich mbutrovich added the enhancement New feature or request label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant