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

Calculate n_buffers in FFI_ArrowArray by data layout #1960

Merged
merged 5 commits into from
Jun 29, 2022

Conversation

viirya
Copy link
Member

@viirya viirya commented Jun 29, 2022

Which issue does this PR close?

Closes #1959.

Rationale for this change

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 Jun 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2022

Codecov Report

Merging #1960 (544b97f) into master (55d6073) will increase coverage by 0.01%.
The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master    #1960      +/-   ##
==========================================
+ Coverage   83.47%   83.48%   +0.01%     
==========================================
  Files         221      221              
  Lines       57054    57117      +63     
==========================================
+ Hits        47626    47685      +59     
- Misses       9428     9432       +4     
Impacted Files Coverage Δ
arrow/src/array/mod.rs 100.00% <ø> (ø)
arrow/src/ffi.rs 87.17% <95.00%> (+0.20%) ⬆️
arrow/src/array/data.rs 84.40% <100.00%> (+0.24%) ⬆️
arrow/src/compute/kernels/arithmetic.rs 90.61% <0.00%> (-0.26%) ⬇️
parquet_derive/src/parquet_field.rs 65.75% <0.00%> (-0.23%) ⬇️
parquet/src/file/writer.rs 92.90% <0.00%> (-0.02%) ⬇️
arrow/src/compute/kernels/cast.rs 95.79% <0.00%> (-0.02%) ⬇️
parquet/src/file/metadata.rs 95.15% <0.00%> (+0.02%) ⬆️
parquet/src/encodings/encoding.rs 93.62% <0.00%> (+0.19%) ⬆️

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 55d6073...544b97f. Read the comment docs.

@viirya
Copy link
Member Author

viirya commented Jun 29, 2022

cc @sunchao

@@ -450,7 +450,17 @@ impl FFI_ArrowArray {
let buffers = iter::once(data.null_buffer().cloned())
.chain(data.buffers().iter().map(|b| Some(b.clone())))
.collect::<Vec<_>>();
let n_buffers = buffers.len() as i64;
let data_layout = layout(data.data_type());
// `n_buffers` is the number of buffers by the spec.
Copy link
Member Author

Choose a reason for hiding this comment

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

arrow/src/ffi.rs Show resolved Hide resolved
arrow/src/ffi.rs Show resolved Hide resolved
@viirya
Copy link
Member Author

viirya commented Jun 29, 2022

Seems unrelated test failure.

FAILED TEST: datetime Java producing,  C# consuming

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM

@viirya viirya merged commit 1a5dcb7 into apache:master Jun 29, 2022
@viirya
Copy link
Member Author

viirya commented Jun 29, 2022

Thanks @sunchao

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.

Incorrect n_buffers in FFI_ArrowArray
3 participants