You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/05 03:51:57 UTC

[GitHub] [doris] cambyzju opened a new pull request, #10606: [feature-wip](array-type) add agg function collect_list and collect_set

cambyzju opened a new pull request, #10606:
URL: https://github.com/apache/doris/pull/10606

   # Proposed changes
   
   Issue Number: close #7570
   
   ## Problem Summary:
   
   `collect_list`
   Returns an array consisting of all values in expr within the group.
   The order of elements in the array is non-deterministic. NULL values are excluded.
   
   `collect_set`
   Returns an array consisting of all unique values in expr within the group.
   The order of elements in the array is non-deterministic. NULL values are excluded.
   
   Usage example:
   ```
   mysql> set enable_vectorized_engine=true;
   mysql> set enable_array_type = true;
   
   mysql> select k1,k2,k3 from collect_test order by k1;
   +------+------------+-------+
   | k1   | k2         | k3    |
   +------+------------+-------+
   |    1 | 2022-07-05 | hello |
   |    2 | 2022-07-04 | NULL  |
   |    2 | 2022-07-04 | hello |
   |    3 | NULL       | world |
   |    3 | NULL       | world |
   +------+------------+-------+
   
   mysql> select k1,collect_list(k2),collect_list(k3) from collect_test group by k1 order by k1;
   +------+--------------------------+--------------------+
   | k1   | collect_list(`k2`)       | collect_list(`k3`) |
   +------+--------------------------+--------------------+
   |    1 | [2022-07-05]             | [hello]            |
   |    2 | [2022-07-04, 2022-07-04] | [hello]            |
   |    3 | NULL                     | [world, world]     |
   +------+--------------------------+--------------------+
   
   mysql> select k1,collect_set(k2),collect_set(k3) from collect_test group by k1 order by k1;
   +------+-------------------+-------------------+
   | k1   | collect_set(`k2`) | collect_set(`k3`) |
   +------+-------------------+-------------------+
   |    1 | [2022-07-05]      | [hello]           |
   |    2 | [2022-07-04]      | [hello]           |
   |    3 | NULL              | [world]           |
   +------+-------------------+-------------------+
   ```
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] cambyzju commented on a diff in pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
cambyzju commented on code in PR #10606:
URL: https://github.com/apache/doris/pull/10606#discussion_r915423794


##########
docs/zh-CN/docs/sql-manual/sql-functions/aggregate-functions/collect_list.md:
##########
@@ -0,0 +1,71 @@
+---
+{
+    "title": "COLLECT_LIST",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## COLLECT_LIST
+### description
+#### Syntax
+
+`ARRAY<T> collect_list(expr)`
+
+返回一个包含 epxr 中所有元素(不包括NULL)的数组,数组中元素顺序是不确定的。

Review Comment:
   done



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] cambyzju commented on pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
cambyzju commented on PR #10606:
URL: https://github.com/apache/doris/pull/10606#issuecomment-1177289851

   update regression-test output, because the output format for type ARRAY<String> have changed in pr10498.
   
   https://github.com/apache/doris/pull/10498


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] BiteTheDDDDt merged pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt merged PR #10606:
URL: https://github.com/apache/doris/pull/10606


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10606:
URL: https://github.com/apache/doris/pull/10606#issuecomment-1177012198

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10606:
URL: https://github.com/apache/doris/pull/10606#issuecomment-1178499756

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] BiteTheDDDDt commented on a diff in pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #10606:
URL: https://github.com/apache/doris/pull/10606#discussion_r915413397


##########
docs/zh-CN/docs/sql-manual/sql-functions/aggregate-functions/collect_list.md:
##########
@@ -0,0 +1,71 @@
+---
+{
+    "title": "COLLECT_LIST",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## COLLECT_LIST
+### description
+#### Syntax
+
+`ARRAY<T> collect_list(expr)`
+
+返回一个包含 epxr 中所有元素(不包括NULL)的数组,数组中元素顺序是不确定的。

Review Comment:
   `expr`



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10606: [feature-wip](array-type) add agg function collect_list and collect_set

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10606:
URL: https://github.com/apache/doris/pull/10606#issuecomment-1177012228

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org