Skip to content

Avoid per-row allocations in to_char #20634

@neilconway

Description

@neilconway

Is your feature request related to a problem or challenge?

In both the scalar and array arg paths, to_char allocates a string for every row, and then does a final copy via StringArray::from to convert the results to Arrow format.

Instead, we can use a reusable buffer for the output of ArrayFormatter, and then append into a StringBuilder. That avoids the per-row allocation.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions