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

ARROW-10639: [Rust] Added examples to is_null kernel and simplified signature. #8701

Closed
wants to merge 1 commit into from
Closed

Conversation

jorgecarleitao
Copy link
Member

The change in signature was motivated while writing the example: there is no reason to wrap a concrete array on an Arc just to be able to pass it to the kernel. All kernels require an immutable reference to anything that implements Array, and thus asking for &Arc<dyn Array> seems to be equivalent / worse as asking for &Vec<> instead of &[] that clippy complaints about.

Apart from that, this adds the examples.

@jorgecarleitao
Copy link
Member Author

Any thoughts, @alamb , @nevi-me , @andygrove , since the requirement of ArrayRef seems to be prevalent on the Arrow crate.

@github-actions
Copy link

Copy link
Contributor

@vertexclique vertexclique left a comment

Choose a reason for hiding this comment

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

This is a good pr and breaking change for some code. p.s. we need to change some code internally after this pr.

Comment on lines +115 to +118
/// # Error
/// This function never errors.
/// # Example
/// ```rust
Copy link
Contributor

Choose a reason for hiding this comment

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

What I do in doctests and comments is give a space between each of them like:

Suggested change
/// # Error
/// This function never errors.
/// # Example
/// ```rust
/// # Error
///
/// This function never errors.
///
/// # Example
///
/// ```rust

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This looks good to me, FWIW.

It seems to me ArrayRef is only valuable if the code needs a very cheap way to copy the entire input (e.g. to another record batch). Given that is not the case with is_not_null I think removing the Arc wrapper makes the API more general. 👍

@alamb
Copy link
Contributor

alamb commented Nov 18, 2020

CI failure looks unrelated .https://github.com/apache/arrow/pull/8701/checks?check_run_id=1416672486

Post job cleanup.
/bin/tar -cz -f /home/runner/work/_temp/12b36759-0d9b-4d6e-a632-53d6873d7dad/cache.tgz -C /home/runner/work/arrow/arrow/.docker .
Warning: read ECONNRESET
events.js:187
      throw er; // Unhandled 'error' event
      ^

I am restarting it

@alamb alamb closed this in a7e02c4 Nov 19, 2020
@jorgecarleitao jorgecarleitao deleted the is_null_array branch December 4, 2020 07:40
@jorgecarleitao jorgecarleitao restored the is_null_array branch December 4, 2020 07:41
@jorgecarleitao jorgecarleitao deleted the is_null_array branch December 14, 2020 07:35
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
…ignature.

The change in signature was motivated while writing the example: there is no reason to wrap a concrete array on an `Arc` just to be able to pass it to the kernel. All kernels require an immutable reference to anything that implements `Array`, and thus asking for `&Arc<dyn Array>` seems to be equivalent / worse as asking for `&Vec<>` instead of `&[]` that clippy complaints about.

Apart from that, this adds the examples.

Closes apache#8701 from jorgecarleitao/is_null_array

Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

None yet

3 participants