You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2024/03/02 04:03:23 UTC

[PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Weijun-H opened a new pull request, #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425

   ## 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.
   -->
   
   Parts #9285
   
   ## 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.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   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 `api 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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#discussion_r1510121510


##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -319,3 +316,125 @@ pub fn gen_range(
     )?);
     Ok(arr)
 }
+
+/// Returns the length of each array dimension

Review Comment:
   I think the difficult part is naming the category name. Like `array_append`, `array_prepend` and `array_concat`. Should we name it `mutable`? How about pop_front and pop_back.



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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

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


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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#discussion_r1510223670


##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -319,3 +316,125 @@ pub fn gen_range(
     )?);
     Ok(arr)
 }
+
+/// Returns the length of each array dimension

Review Comment:
   I agree how to organize the functions is not clear. 
   
   We could always just make one file for each function, I suppose. `array_append.rs`, `array_prepend.rs`, etc. Though that feels like a bit of an overkill



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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#discussion_r1510006973


##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -319,3 +316,125 @@ pub fn gen_range(
     )?);
     Ok(arr)
 }
+
+/// Returns the length of each array dimension

Review Comment:
   I know this is just following the existing pattern of array_functions, but I wonder if it would be better to organize the code by function. 
   
   For example, we could put the UDF and implementations in `datafusion/functions-array/src/dims.rs` 🤔 
   
   We could definitely do this as a follow on PR
   
   Any thoughts @jayzhan211 ?



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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#issuecomment-1974322937

   @Weijun-H Can you also add a roundtrip test for those functions? 
   https://github.com/apache/arrow-datafusion/blob/2a490e48c924b76a2d389227c674b9f81b0404c8/datafusion/proto/tests/cases/roundtrip_logical_plan.rs#L578-L582


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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#discussion_r1510121122


##########
datafusion/functions-array/src/kernels.rs:
##########
@@ -319,3 +316,125 @@ pub fn gen_range(
     )?);
     Ok(arr)
 }
+
+/// Returns the length of each array dimension

Review Comment:
   Should we split two files udf and kernel inside `dims`?



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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#issuecomment-1974855011

   Looks like there is a conflict that needs to be resolved


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


Re: [PR] move ArrayDims, ArrayNdims and Cardinality to datafusion-function-crate [arrow-datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #9425:
URL: https://github.com/apache/arrow-datafusion/pull/9425#issuecomment-1975002391

   Thanks @Weijun-H 


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