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

Take kernel dyn Array #4705

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Take kernel dyn Array #4705

merged 1 commit into from
Aug 17, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Aug 16, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

Having the take kernel accept a dyn Array achieves a couple of things:

  • It makes it consistent with the direction of travel for other arrays
  • It avoids needing to downcast indices where the type is not known - e.g. a future AnyDictionary abstraction
  • It allows coercing key types to a smaller set of types to reduce codegen

What changes are included in this PR?

Are there any user-facing changes?

This is a breaking change to the take kernel, but most code will not notice

@tustvold tustvold added the api-change Changes to the arrow API label Aug 16, 2023
@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 16, 2023
Comment on lines +748 to +752
to_indices_identity!(UInt32Type);
to_indices_reinterpret!(Int32Type, UInt32Type);

to_indices_identity!(UInt64Type);
to_indices_reinterpret!(Int64Type, UInt64Type);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32-bit and 64-bit indices are both relatively common and I think justify having separate specializations

Comment on lines +742 to +746
to_indices_widening!(UInt8Type, UInt32Type);
to_indices_widening!(Int8Type, UInt32Type);

to_indices_widening!(UInt16Type, UInt32Type);
to_indices_widening!(Int16Type, UInt32Type);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8-bit and 16-bit indices are very rare in my experience, if this becomes a performance issue for people we can easily change the specializations based on that feedback

@tustvold tustvold merged commit 8102911 into apache:master Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants