Skip to content

In set ops, avoid RowConverter for results when possible #20622

@neilconway

Description

@neilconway

Is your feature request related to a problem or challenge?

Several array set operations (e.g., array_distinct, array_union, array_intersect, array_except) have this property:

  • Convert the input(s) using RowConverter, ideally in bulk
  • Apply the set operation as appropriate, which adds or removes elements from the set of Rows
  • Convert the final set of Rows back into ArrayRef

However, we can do a little better for the final step: instead of converting from Rows back into ArrayRef, we can just track which indices in the input(s) correspond to the values we want to return. We can then grab those values with a single take, which avoids the Row-to-Arrayref deserialization overhead.

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