Skip to content

Improve ArrowWriter performance for fixed-length vectors #888

@mbutrovich

Description

@mbutrovich

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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