You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Mryange (via GitHub)" <gi...@apache.org> on 2024/03/15 13:13:27 UTC

[PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

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

   ## Proposed changes
   
   in this https://github.com/apache/doris/pull/32112, handling empty sets (empty expression cases) has been addressed. However, multiple empty sets in grouping sets have different grouping IDs
   
   https://dbfiddle.uk/VYe7V2Mn
   
   
   <!--Describe your changes.-->
   
   ## 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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "Mryange (via GitHub)" <gi...@apache.org>.
Mryange commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-1999638763

   run buildall


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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "Mryange (via GitHub)" <gi...@apache.org>.
Mryange commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-1999911262

   run p0


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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-2002869957

   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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "HappenLee (via GitHub)" <gi...@apache.org>.
HappenLee commented on code in PR #32317:
URL: https://github.com/apache/doris/pull/32317#discussion_r1527748803


##########
be/src/pipeline/exec/repeat_operator.cpp:
##########
@@ -228,8 +235,16 @@ Status RepeatOperatorX::pull(doris::RuntimeState* state, vectorized::Block* outp
             _repeat_id_idx = 0;
         }
     } else if (local_state._expr_ctxs.empty()) {
-        DCHECK(!_intermediate_block || (_intermediate_block && _intermediate_block->rows() == 0));
-        output_block->swap(_child_block);
+        auto m_block = vectorized::VectorizedUtils::build_mutable_mem_reuse_block(output_block,
+                                                                                  _output_slots);
+        auto rows = _child_block.rows();
+        auto& columns = m_block.mutable_columns();
+
+        for (int repeat_id_idx = 0; repeat_id_idx < _repeat_id_list.size(); repeat_id_idx++) {
+            std::size_t cur_col = 0;
+            RETURN_IF_ERROR(

Review Comment:
   why call ```local_state.add_grouping_id_column(rows, 0, columns, repeat_id_idx));```



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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-1999671135

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 38453 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit df6ec461097159833a70040f1a21a174a16f1e07, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17655	4469	4137	4137
   q2	2031	155	143	143
   q3	10692	1114	893	893
   q4	7805	760	745	745
   q5	7484	2796	2707	2707
   q6	187	129	120	120
   q7	1154	837	803	803
   q8	9329	2054	2012	2012
   q9	7127	6397	6401	6397
   q10	8443	3456	3596	3456
   q11	421	222	217	217
   q12	635	300	308	300
   q13	17794	2880	2866	2866
   q14	279	237	250	237
   q15	501	456	450	450
   q16	494	391	379	379
   q17	963	586	535	535
   q18	7548	6491	6616	6491
   q19	4558	1471	1412	1412
   q20	569	291	284	284
   q21	6178	3561	3585	3561
   q22	348	308	321	308
   Total cold run time: 112195 ms
   Total hot run time: 38453 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	4194	4099	4111	4099
   q2	323	221	222	221
   q3	2971	2854	2765	2765
   q4	1837	1503	1546	1503
   q5	5224	5249	5236	5236
   q6	189	114	126	114
   q7	2227	1852	1859	1852
   q8	3150	3273	3294	3273
   q9	8571	8535	8552	8535
   q10	3748	3651	3670	3651
   q11	559	452	441	441
   q12	717	530	539	530
   q13	16901	2861	2851	2851
   q14	273	253	246	246
   q15	483	442	441	441
   q16	452	413	398	398
   q17	1745	1484	1473	1473
   q18	7638	7296	6979	6979
   q19	1643	1526	1504	1504
   q20	1919	1714	1722	1714
   q21	4693	4682	4662	4662
   q22	552	468	463	463
   Total cold run time: 70009 ms
   Total hot run time: 52951 ms
   ```
   </details>
   


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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-1999695863

   TeamCity be ut coverage result:
    Function Coverage: 34.94% (8573/24535) 
    Line Coverage: 26.64% (69481/260783)
    Region Coverage: 25.93% (36095/139186)
    Branch Coverage: 22.87% (18430/80576)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/df6ec461097159833a70040f1a21a174a16f1e07_df6ec461097159833a70040f1a21a174a16f1e07/report/index.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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-1999638615

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)


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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "BiteTheDDDDt (via GitHub)" <gi...@apache.org>.
BiteTheDDDDt merged PR #32317:
URL: https://github.com/apache/doris/pull/32317


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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32317:
URL: https://github.com/apache/doris/pull/32317#issuecomment-2002869975

   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


Re: [PR] [fix](grouping sets) fix grouping sets have multiple empty sets. [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #32317:
URL: https://github.com/apache/doris/pull/32317#discussion_r1526277629


##########
be/src/pipeline/exec/repeat_operator.cpp:
##########
@@ -158,6 +158,17 @@ Status RepeatLocalState::get_repeated_block(vectorized::Block* child_block, int
 
     const auto rows = child_block->rows();
     // Fill grouping ID to block
+    RETURN_IF_ERROR(add_grouping_id_column(rows, cur_col, columns, repeat_id_idx));
+
+    DCHECK_EQ(cur_col, column_size);
+
+    return Status::OK();
+}
+
+Status RepeatLocalState::add_grouping_id_column(std::size_t rows, std::size_t& cur_col,

Review Comment:
   warning: method 'add_grouping_id_column' can be made static [readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status RepeatLocalState::add_grouping_id_column(std::size_t rows, std::size_t& cur_col,
   ```
   



##########
be/src/vec/exec/vrepeat_node.cpp:
##########
@@ -153,6 +153,15 @@ Status VRepeatNode::get_repeated_block(Block* child_block, int repeat_id_idx, Bl
 
     const auto rows = child_block->rows();
     // Fill grouping ID to block
+    RETURN_IF_ERROR(add_grouping_id_column(rows, cur_col, columns, repeat_id_idx));
+    output_block->set_columns(std::move(columns));
+    DCHECK_EQ(cur_col, column_size);
+
+    return Status::OK();
+}
+
+Status VRepeatNode::add_grouping_id_column(std::size_t rows, std::size_t& cur_col,

Review Comment:
   warning: method 'add_grouping_id_column' can be made static [readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status VRepeatNode::add_grouping_id_column(std::size_t rows, std::size_t& cur_col,
   ```
   



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