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

Remove StringOffsetTrait and BinaryOffsetTrait #1645

Merged
merged 3 commits into from
May 6, 2022

Conversation

HaoYang670
Copy link
Contributor

Which issue does this PR close?

Closes #1644.

Rationale for this change

What changes are included in this PR?

  1. Remove StringOffsetTrait and BinaryOffsetTrait
  2. Add get_data_type function for StringArray and BinaryArray (unfortunately, this function cannot be const because OffsetSizeTrait::is_large is not const)

Are there any user-facing changes?

Yes. Delete 2 public traits.

Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label May 4, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1645 (1b5d943) into master (22e9f95) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1645   +/-   ##
=======================================
  Coverage   83.02%   83.03%           
=======================================
  Files         193      193           
  Lines       55612    55622   +10     
=======================================
+ Hits        46174    46184   +10     
  Misses       9438     9438           
Impacted Files Coverage Δ
arrow/src/array/builder.rs 86.79% <ø> (ø)
arrow/src/array/equal_json.rs 89.70% <ø> (ø)
arrow/src/array/iterator.rs 96.11% <ø> (ø)
arrow/src/array/mod.rs 100.00% <ø> (ø)
arrow/src/array/ord.rs 69.17% <ø> (ø)
arrow/src/compute/kernels/filter.rs 88.33% <ø> (ø)
arrow/src/compute/kernels/length.rs 100.00% <ø> (ø)
arrow/src/compute/kernels/take.rs 95.41% <ø> (ø)
arrow/src/array/array_binary.rs 93.02% <100.00%> (+0.03%) ⬆️
arrow/src/array/array_string.rs 97.73% <100.00%> (+0.03%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22e9f95...1b5d943. Read the comment docs.

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Hmm, why don't we just make a const is_large in OffsetSizeTrait simply?

pub trait OffsetSizeTrait {
  const IS_LARGE: bool;
}
impl OffsetSizeTrait for i32 {
    const IS_LARGE: bool = false;
}

impl OffsetSizeTrait for i64 {
    const IS_LARGE: bool = true
}

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just one question above.

@HaoYang670
Copy link
Contributor Author

HaoYang670 commented May 4, 2022

Hmm, why don't we just make a const is_large in OffsetSizeTrait simply?

Strongly agree with you!
I will create a follow-up issue to track this.
Tracked in #1658

Signed-off-by: remzi <13716567376yh@gmail.com>
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Minor nit you can take or leave, will merge later today.

Thanks 👍

arrow/src/array/array_binary.rs Show resolved Hide resolved
arrow/src/array/array_string.rs Show resolved Hide resolved
@tustvold
Copy link
Contributor

tustvold commented May 6, 2022

Going to get this in as the merge conflict potential is high

@tustvold tustvold merged commit a38e460 into apache:master May 6, 2022
@tustvold tustvold added the api-change Changes to the arrow API label May 6, 2022
@HaoYang670 HaoYang670 deleted the simplify_offsetTrait branch May 6, 2022 06:54
@alamb
Copy link
Contributor

alamb commented May 6, 2022

arrow 14 is shaping up for another great release 🎉

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.

Remove StringOffsetTrait and BinaryOffsetTrait
5 participants