Skip to content

chore: Revise array import to more follow C Data Interface semantics#905

Merged
viirya merged 8 commits intoapache:mainfrom
viirya:move_native_struct
Sep 6, 2024
Merged

chore: Revise array import to more follow C Data Interface semantics#905
viirya merged 8 commits intoapache:mainfrom
viirya:move_native_struct

Conversation

@viirya
Copy link
Copy Markdown
Member

@viirya viirya commented Sep 3, 2024

Which issue does this PR close?

Closes #885.

Rationale for this change

This is another part of #885. In #893, we already revised the way we export arrays to native side. We now allocate array/schema structures in native side when exporting arrays from JVM to native.

Similarly, this PR revises the way we import array from native side by allocating array/schema structures in JVM when importing arrays from native to JVM.

What changes are included in this PR?

How are these changes tested?

@viirya viirya force-pushed the move_native_struct branch from 00ac1e4 to 8a94f10 Compare September 3, 2024 20:29
@andygrove
Copy link
Copy Markdown
Member

@Kontinuation fyi

@viirya viirya force-pushed the move_native_struct branch 2 times, most recently from feb1fea to f6def47 Compare September 4, 2024 06:04
@viirya viirya force-pushed the move_native_struct branch from f6def47 to f748ba3 Compare September 4, 2024 15:27
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 43.58974% with 22 lines in your changes missing coverage. Please review.

Project coverage is 54.85%. Comparing base (033fe6f) to head (a34bfc4).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...ain/scala/org/apache/comet/vector/NativeUtil.scala 0.00% 22 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main     #905       +/-   ##
=============================================
+ Coverage     34.03%   54.85%   +20.81%     
+ Complexity      883      853       -30     
=============================================
  Files           113      109        -4     
  Lines         43170    10667    -32503     
  Branches       9516     2044     -7472     
=============================================
- Hits          14693     5851     -8842     
+ Misses        25471     3787    -21684     
+ Partials       3006     1029     -1977     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@viirya
Copy link
Copy Markdown
Member Author

viirya commented Sep 4, 2024

Okay. The latest commit fixes the SIGSEGV errors.

@viirya viirya force-pushed the move_native_struct branch from 2f862f2 to ad61ee9 Compare September 5, 2024 20:31

/// Prepares arrow arrays for output.
fn prepare_output(
unsafe fn prepare_output(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to narrow down the area of unsafe?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay

@viirya
Copy link
Copy Markdown
Member Author

viirya commented Sep 6, 2024

I will go to merge this today if no more comments. Thank you.

@viirya viirya merged commit 6c2c182 into apache:main Sep 6, 2024
@viirya
Copy link
Copy Markdown
Member Author

viirya commented Sep 6, 2024

Merged. Thanks @andygrove @Kontinuation @kazuyukitanimura

@viirya viirya deleted the move_native_struct branch September 6, 2024 19:13
@viirya
Copy link
Copy Markdown
Member Author

viirya commented Sep 6, 2024

Ah, I found I forgot to commit the patch addressing latest reviews #905 (comment) and #905 (comment).

Opend a followup at #920 for that.

coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
…pache#905)

* chore: Revise array import to more follow C Data Interface semantics

* more

* fix

* For review

* Try

* check alignment

* Try

* Add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Following the memory management semantics stated in the Arrow C Data Interface Specification

5 participants