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 2023/01/12 06:54:46 UTC

[GitHub] [doris] ByteYue opened a new pull request, #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   # Proposed changes
   
   Issue Number: close #xxx
   If block bytes are bigger than the corresponding block's rows, then the avg_size_per_row would be zero. Which would end up diving zero in the following logic.
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [x] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [x] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [x] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [x] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [x] 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] yiguolei merged pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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


-- 
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] jacktengg commented on a diff in pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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


##########
regression-test/suites/demo_p0/merge_sort.groovy:
##########
@@ -0,0 +1,45 @@
+// 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.
+
+// when rows is bigger than block bytes, it might cause diving zero error
+suite("merge_sort_rows_bigger_than_bytes") {
+
+    sql """ DROP TABLE IF EXISTS B """
+    sql """
+        CREATE TABLE IF NOT EXISTS B
+        (
+            b_id int
+        )
+        DISTRIBUTED BY HASH(b_id) BUCKETS 1
+        PROPERTIES("replication_num" = "1");
+    """
+
+    sql " INSERT INTO B values (1);"
+
+    qt_sql """
+        SELECT subq_0.`c1` AS c1
+        FROM
+        (SELECT version() AS c0,
+                  ref_0.`id` AS c1
+        FROM test_streamload_action1 AS ref_0
+        LEFT JOIN B AS ref_9 ON (ref_0.`id` = ref_9.`b_id`)
+        WHERE ref_9.`b_id` IS NULL) AS subq_0
+        WHERE subq_0.`c0` IS NOT NULL
+        ORDER BY subq_0.`c0` DESC

Review Comment:
   need add another other by to ensure test result stability.



-- 
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 #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] jacktengg commented on a diff in pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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


##########
regression-test/suites/demo_p0/merge_sort.groovy:
##########
@@ -0,0 +1,45 @@
+// 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.
+
+// when rows is bigger than block bytes, it might cause diving zero error
+suite("merge_sort_rows_bigger_than_bytes") {
+
+    sql """ DROP TABLE IF EXISTS B """
+    sql """
+        CREATE TABLE IF NOT EXISTS B
+        (
+            b_id int
+        )
+        DISTRIBUTED BY HASH(b_id) BUCKETS 1
+        PROPERTIES("replication_num" = "1");
+    """
+
+    sql " INSERT INTO B values (1);"
+
+    qt_sql """
+        SELECT subq_0.`c1` AS c1
+        FROM
+        (SELECT version() AS c0,
+                  ref_0.`id` AS c1
+        FROM test_streamload_action1 AS ref_0
+        LEFT JOIN B AS ref_9 ON (ref_0.`id` = ref_9.`b_id`)
+        WHERE ref_9.`b_id` IS NULL) AS subq_0
+        WHERE subq_0.`c0` IS NOT NULL
+        ORDER BY subq_0.`c0` DESC

Review Comment:
   need add another order by to ensure test result stability.



-- 
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 #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] jacktengg commented on pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   LGTM


-- 
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] jacktengg commented on pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   LGTM


-- 
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] hello-stephen commented on pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #15859:
URL: https://github.com/apache/doris/pull/15859#issuecomment-1380077818

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 36.29 seconds
    load time: 560 seconds
    storage size: 17123097128 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230112095621_clickbench_pr_78803.html


-- 
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] ByteYue commented on a diff in pull request #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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


##########
regression-test/suites/demo_p0/merge_sort.groovy:
##########
@@ -0,0 +1,45 @@
+// 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.
+
+// when rows is bigger than block bytes, it might cause diving zero error
+suite("merge_sort_rows_bigger_than_bytes") {
+
+    sql """ DROP TABLE IF EXISTS B """
+    sql """
+        CREATE TABLE IF NOT EXISTS B
+        (
+            b_id int
+        )
+        DISTRIBUTED BY HASH(b_id) BUCKETS 1
+        PROPERTIES("replication_num" = "1");
+    """
+
+    sql " INSERT INTO B values (1);"
+
+    qt_sql """
+        SELECT subq_0.`c1` AS c1
+        FROM
+        (SELECT version() AS c0,
+                  ref_0.`id` AS c1
+        FROM test_streamload_action1 AS ref_0
+        LEFT JOIN B AS ref_9 ON (ref_0.`id` = ref_9.`b_id`)
+        WHERE ref_9.`b_id` IS NULL) AS subq_0
+        WHERE subq_0.`c0` IS NOT NULL
+        ORDER BY subq_0.`c0` DESC

Review Comment:
   > need add another order by to ensure test result stability.
   
   OK, I'll refresh the regression case after I've rebuilt the be binary and run the case.



-- 
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 #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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 #15859: [Bug](sort)fix merge sorter might div zero when block bytes less than block rows

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

   clang-tidy review says "All clean, LGTM! :+1:"


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