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

Rework Strongly Typed ArrayData Abstractions #3877

Closed
wants to merge 2 commits into from

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Part of #1799

Rationale for this change

See #1799 (comment)

In particular:

  • Moves from_raw to From<ArrayData>
  • Moves layout to From<_> for ArrayData
  • Removes ArrayDataLayout

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 16, 2023
/// 2: the values
///
/// We store an array so that a slice can be returned in [`RunArrayData::layout`]
children: Box<[ArrayData; 2]>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We no longer need this hack 🎉

/// ArrayData for [dictionary arrays](https://arrow.apache.org/docs/format/Columnar.html#dictionary-encoded-layout)
#[derive(Debug, Clone)]
pub struct DictionaryArrayData<K: DictionaryKey> {
data_type: DataType,
nulls: Option<NullBuffer>,
keys: ScalarBuffer<K>,
values: Box<ArrayData>,
values: ArrayData,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We no longer need to Box children, as not intending to use within an ArrayData enumeration

@tustvold
Copy link
Contributor Author

Realised these need to check the DataType when converting from ArrayData, will fix tomorrow

@tustvold tustvold marked this pull request as draft March 16, 2023 23:21
@tustvold
Copy link
Contributor Author

Thinking about this a bit more, it is unclear what value add these abstractions have over the existing arrays... There may be more simplification possible... 🤔

@tustvold
Copy link
Contributor Author

Closing in favor of #3880

@tustvold tustvold closed this Mar 17, 2023
tustvold added a commit to tustvold/arrow-rs that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant