You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "parkma99 (via GitHub)" <gi...@apache.org> on 2023/06/08 02:42:54 UTC

[GitHub] [arrow-datafusion] parkma99 opened a new pull request, #6593: feat: make_array support empty arguments

parkma99 opened a new pull request, #6593:
URL: https://github.com/apache/arrow-datafusion/pull/6593

   # 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 #6561 
   
   # 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?
   add 2 tests in array.slt
   <!--
   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


[GitHub] [arrow-datafusion] izveigor commented on a diff in pull request #6593: feat: make_array support empty arguments

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


##########
datafusion/core/tests/sqllogictests/test_files/array.slt:
##########
@@ -157,6 +223,18 @@ select trim_array([[1, 2], [3, 4], [5, 6]], 2), trim_array(array_fill(4, [3, 4,
 ----
 [[1, 2]] [[[4, 4], [4, 4], [4, 4], [4, 4]]]
 
+# trim_array scalar function #3
+query ?
+select array_concat(trim_array(make_array(1, 2, 3), 3), make_array(4, 5), make_array());
+----
+[4, 5]
+
+# trim_array scalar function #3

Review Comment:
   `# trim_array scalar function #4`



-- 
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-datafusion] alamb merged pull request #6593: feat: make_array support empty arguments

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


-- 
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-datafusion] parkma99 commented on pull request #6593: feat: make_array support empty arguments

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

   > Thank you, @parkma99. It looks good!
   
   Thanks for reviewing 


-- 
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-datafusion] alamb commented on a diff in pull request #6593: feat: make_array support empty arguments

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


##########
datafusion/physical-expr/src/functions.rs:
##########
@@ -404,7 +404,7 @@ pub fn create_physical_fun(
             Arc::new(array_expressions::array_to_string)
         }
         BuiltinScalarFunction::Cardinality => Arc::new(array_expressions::cardinality),
-        BuiltinScalarFunction::MakeArray => Arc::new(array_expressions::array),
+        BuiltinScalarFunction::MakeArray => Arc::new(array_expressions::array_make),

Review Comment:
   I fixed this in d91f66704 (it was a little tricky because `make_array` is also a function in arrow so some new aliasing was needed



-- 
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-datafusion] parkma99 commented on pull request #6593: feat: make_array support empty arguments

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

   > Thank you @parkma99 -- I think @dadepo and @izveigor have some good comments that would be worth considering, but also I think this PR could be merged as is
   
   Thank you @alamb for reviewing.


-- 
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-datafusion] dadepo commented on a diff in pull request #6593: feat: make_array support empty arguments

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


##########
datafusion/physical-expr/src/functions.rs:
##########
@@ -404,7 +404,7 @@ pub fn create_physical_fun(
             Arc::new(array_expressions::array_to_string)
         }
         BuiltinScalarFunction::Cardinality => Arc::new(array_expressions::cardinality),
-        BuiltinScalarFunction::MakeArray => Arc::new(array_expressions::array),
+        BuiltinScalarFunction::MakeArray => Arc::new(array_expressions::array_make),

Review Comment:
   Won't `make_array` be a better, more consistent renaming for the function?



-- 
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-datafusion] parkma99 commented on pull request #6593: feat: make_array support empty arguments

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

   > I took the liberty of merging this branch from master and resolving the conflicts (which I largely created via #6612) in [0947cfd](https://github.com/apache/arrow-datafusion/commit/0947cfd589f2a40b456238104d5627a14909cbdc)
   > 
   > Since I was changing stuff anyways, I also made the change suggested by @dadepo in [#6593 (comment)](https://github.com/apache/arrow-datafusion/pull/6593#discussion_r1223876408) as part of
   
   Thank you @alamb 


-- 
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-datafusion] alamb commented on pull request #6593: feat: make_array support empty arguments

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

   I took the liberty of merging this branch from master and resolving the conflicts (which I largely created via https://github.com/apache/arrow-datafusion/pull/6612) in 0947cfd589f2a40b456238104d5627a14909cbdc
   
   Since I was changing stuff anyways, I also made the change suggested by @dadepo  in https://github.com/apache/arrow-datafusion/pull/6593#discussion_r1223876408 as part of 
   


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