You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/23 05:45:44 UTC

[GitHub] [arrow-rs] roee88 opened a new pull request #600: fix: release of FFI structures

roee88 opened a new pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600


   Closes #595.
   
   # What changes are included in this PR?
   
   FFI schema and array release is aligned with the specification. Own allocations performed on the rust producer side are kept in private data for bookeeping.
   
   <!---
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   Might be, due to `with_name`. In draft for a discussion.
   
   <!---
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-rs] codecov-commenter commented on pull request #600: fix: release of FFI structures

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600#issuecomment-885419295


   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#600](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bcbb96e) into [master](https://codecov.io/gh/apache/arrow-rs/commit/9f40f899e439d072fc859e0b4abf46776387e0d1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9f40f89) will **increase** coverage by `0.01%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-rs/pull/600/graphs/tree.svg?width=650&height=150&src=pr&token=pq9V9qWZ1N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #600      +/-   ##
   ==========================================
   + Coverage   82.46%   82.47%   +0.01%     
   ==========================================
     Files         167      167              
     Lines       46205    46228      +23     
   ==========================================
   + Hits        38101    38125      +24     
   + Misses       8104     8103       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [arrow/src/ffi.rs](https://codecov.io/gh/apache/arrow-rs/pull/600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2ZmaS5ycw==) | `88.30% <100.00%> (+1.23%)` | :arrow_up: |
   | [arrow/src/array/transform/boolean.rs](https://codecov.io/gh/apache/arrow-rs/pull/600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L3RyYW5zZm9ybS9ib29sZWFuLnJz) | `76.92% <0.00%> (-7.70%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9f40f89...bcbb96e](https://codecov.io/gh/apache/arrow-rs/pull/600?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-rs] roee88 commented on a change in pull request #600: fix: release of FFI structures

Posted by GitBox <gi...@apache.org>.
roee88 commented on a change in pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600#discussion_r675320016



##########
File path: arrow/src/ffi.rs
##########
@@ -158,23 +195,26 @@ impl FFI_ArrowSchema {
             .map(Box::into_raw)
             .collect::<Box<_>>();
 
-        this.format = CString::new(format).unwrap().into_raw();
-        this.release = Some(release_schema);
+        this.release = Some(release_schema_callback);
         this.n_children = children_ptr.len() as i64;
 
         let mut private_data = Box::new(SchemaPrivateData {
             children: children_ptr,
+            format: CString::new(format).unwrap(),
+            name: None,
         });
 
         // intentionally set from private_data (see https://github.com/apache/arrow-rs/issues/580)
         this.children = private_data.children.as_mut_ptr();
+        this.format = private_data.format.as_ptr();
 
         this.private_data = Box::into_raw(private_data) as *mut c_void;
 
         Ok(this)
     }
 
     pub fn with_name(mut self, name: &str) -> Result<Self> {
+        // TODO: should go in private data just like format

Review comment:
       @kszucs I opened this draft PR mainly for discussion this

##########
File path: arrow/src/ffi.rs
##########
@@ -158,23 +195,26 @@ impl FFI_ArrowSchema {
             .map(Box::into_raw)
             .collect::<Box<_>>();
 
-        this.format = CString::new(format).unwrap().into_raw();
-        this.release = Some(release_schema);
+        this.release = Some(release_schema_callback);
         this.n_children = children_ptr.len() as i64;
 
         let mut private_data = Box::new(SchemaPrivateData {
             children: children_ptr,
+            format: CString::new(format).unwrap(),
+            name: None,
         });
 
         // intentionally set from private_data (see https://github.com/apache/arrow-rs/issues/580)
         this.children = private_data.children.as_mut_ptr();
+        this.format = private_data.format.as_ptr();
 
         this.private_data = Box::into_raw(private_data) as *mut c_void;
 
         Ok(this)
     }
 
     pub fn with_name(mut self, name: &str) -> Result<Self> {
+        // TODO: should go in private data just like format

Review comment:
       @kszucs I opened this draft PR mainly for discussing this




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-rs] roee88 closed pull request #600: fix: release of FFI structures

Posted by GitBox <gi...@apache.org>.
roee88 closed pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-rs] alamb commented on pull request #600: fix: release of FFI structures

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600#issuecomment-886189665


   Did you mean to close this PR @roee88  ? Or perhaps shall we leave it as a draft?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org