You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "smiklos (via GitHub)" <gi...@apache.org> on 2023/07/24 18:50:01 UTC

[GitHub] [arrow-rs] smiklos opened a new pull request, #4566: support NullArray un arith/boolean kernel

smiklos opened a new pull request, #4566:
URL: https://github.com/apache/arrow-rs/pull/4566

   # Which issue does this PR close?
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #4565.
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   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.
   -->
   Since NullArray has no nulls buffer, we need to handle that case for `is_null` and `is_not_null` to work correctly
   
   # Are there any user-facing changes?
   Nope
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   Don't think so
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   Nope


-- 
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] tustvold commented on pull request #4566: support NullArray un arith/boolean kernel

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #4566:
URL: https://github.com/apache/arrow-rs/pull/4566#issuecomment-1649756794

   Thank you


-- 
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] smiklos commented on a diff in pull request #4566: support NullArray un arith/boolean kernel

Posted by "smiklos (via GitHub)" <gi...@apache.org>.
smiklos commented on code in PR #4566:
URL: https://github.com/apache/arrow-rs/pull/4566#discussion_r1272720072


##########
arrow-arith/src/boolean.rs:
##########
@@ -332,7 +339,14 @@ pub fn is_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
 /// ```
 pub fn is_not_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
     let values = match input.nulls() {
-        None => BooleanBuffer::new_set(input.len()),
+        None => {
+            // NullArray has no nulls buffer yet all values are null
+            if input.data_type().equals_datatype(&DataType::Null) {

Review Comment:
   Sure, done (both)



-- 
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] tustvold commented on a diff in pull request #4566: support NullArray un arith/boolean kernel

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #4566:
URL: https://github.com/apache/arrow-rs/pull/4566#discussion_r1272708297


##########
arrow-arith/src/boolean.rs:
##########
@@ -332,7 +339,14 @@ pub fn is_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
 /// ```
 pub fn is_not_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
     let values = match input.nulls() {
-        None => BooleanBuffer::new_set(input.len()),
+        None => {
+            // NullArray has no nulls buffer yet all values are null
+            if input.data_type().equals_datatype(&DataType::Null) {

Review Comment:
   ```suggestion
               if input.data_type() == &DataType::Null {
   ```
   Could also possibly be lifted into the match expression



-- 
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] tustvold merged pull request #4566: support NullArray un arith/boolean kernel

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #4566:
URL: https://github.com/apache/arrow-rs/pull/4566


-- 
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] smiklos commented on a diff in pull request #4566: support NullArray un arith/boolean kernel

Posted by "smiklos (via GitHub)" <gi...@apache.org>.
smiklos commented on code in PR #4566:
URL: https://github.com/apache/arrow-rs/pull/4566#discussion_r1272631276


##########
arrow-arith/src/boolean.rs:
##########
@@ -312,7 +312,14 @@ pub fn not(left: &BooleanArray) -> Result<BooleanArray, ArrowError> {
 /// ```
 pub fn is_null(input: &dyn Array) -> Result<BooleanArray, ArrowError> {
     let values = match input.nulls() {
-        None => BooleanBuffer::new_unset(input.len()),
+        // NullArray has no nulls buffer yet all values are null
+        None => {
+            if input.data_type().equals_datatype(&DataType::Null) {

Review Comment:
   or should we check for input to be NullArray? 



-- 
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