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

GH-33936: [Go] C Data Interface: export dummy buffer for nil buffers #33951

Merged
merged 5 commits into from
Jan 31, 2023

Conversation

lidavidm
Copy link
Member

@lidavidm lidavidm commented Jan 31, 2023

Rationale for this change

While #14805 clarified that NULL buffers are valid in the C Data Interface, not all implementations handle this correctly (or were fixed, but earlier versions still exist).

What changes are included in this PR?

Export a non-NULL dummy buffer for nil/empty buffers to ensure compatibility.

Are these changes tested?

A regression test is included.

@github-actions
Copy link

Comment on lines 393 to 399
if i > 0 || !internal.HasValidityBitmap(arr.DataType().ID(), flatbuf.MetadataVersionV5) {
// apache/arrow#33936: export a dummy buffer to be friendly to
// implementations that don't import NULL properly
buffers[i] = (*C.void)(unsafe.Pointer(&C.kGoCdataZeroRegion))
} else {
buffers[i] = nil
}
Copy link
Member

Choose a reason for hiding this comment

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

should this be behind some sort of flag so that we can easily switch back to using nil when the other implementations catch up? Or is that not worth it?

Copy link
Member Author

Choose a reason for hiding this comment

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

If/when we decide to remove it later, I think we should just remove it from the code entirely, instead of trying to flag it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think for Arrow 13 we could circle back and remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

The C++ side fix isn't even shipping until Arrow 12

Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

LGTM just the one question but it's not blocking

@lidavidm lidavidm merged commit 5765aa2 into apache:master Jan 31, 2023
@lidavidm lidavidm deleted the gh-33936 branch January 31, 2023 20:03
@ursabot
Copy link

ursabot commented Feb 1, 2023

Benchmark runs are scheduled for baseline = 3affada and contender = 5765aa2. 5765aa2 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️0.71% ⬆️0.13%] test-mac-arm
[Failed ⬇️0.46% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.35% ⬆️0.06%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 5765aa29 ec2-t3-xlarge-us-east-2
[Failed] 5765aa29 test-mac-arm
[Failed] 5765aa29 ursa-i9-9960x
[Finished] 5765aa29 ursa-thinkcentre-m75q
[Finished] 3affadad ec2-t3-xlarge-us-east-2
[Failed] 3affadad test-mac-arm
[Failed] 3affadad ursa-i9-9960x
[Finished] 3affadad ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot
Copy link

ursabot commented Feb 1, 2023

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

sjperkins pushed a commit to sjperkins/arrow that referenced this pull request Feb 10, 2023
…ffers (apache#33951)

### Rationale for this change

While apache#14805 clarified that NULL buffers are valid in the C Data Interface, not all implementations handle this correctly (or were fixed, but earlier versions still exist).

### What changes are included in this PR?

Export a non-NULL dummy buffer for nil/empty buffers to ensure compatibility.

### Are these changes tested?

A regression test is included.
* Closes: apache#33936

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
gringasalpastor pushed a commit to gringasalpastor/arrow that referenced this pull request Feb 17, 2023
…ffers (apache#33951)

### Rationale for this change

While apache#14805 clarified that NULL buffers are valid in the C Data Interface, not all implementations handle this correctly (or were fixed, but earlier versions still exist).

### What changes are included in this PR?

Export a non-NULL dummy buffer for nil/empty buffers to ensure compatibility.

### Are these changes tested?

A regression test is included.
* Closes: apache#33936

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Feb 24, 2023
…ffers (apache#33951)

### Rationale for this change

While apache#14805 clarified that NULL buffers are valid in the C Data Interface, not all implementations handle this correctly (or were fixed, but earlier versions still exist).

### What changes are included in this PR?

Export a non-NULL dummy buffer for nil/empty buffers to ensure compatibility.

### Are these changes tested?

A regression test is included.
* Closes: apache#33936

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Go] C Data Interface: export a dummy non-null buffer for null/0-size buffers
4 participants