morrySnow commented on code in PR #54822:
URL: https://github.com/apache/doris/pull/54822#discussion_r2284013044
##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -3957,7 +3958,8 @@ public static boolean canUseNereidsDistributePlanner() {
// TODO: support other sink
if (!(logicalPlan instanceof UnboundResultSink
|| logicalPlan instanceof LogicalFileSink
- || logicalPlan instanceof InsertIntoTableCommand)) {
+ || logicalPlan instanceof InsertIntoTableCommand
+ || logicalPlan instanceof UnboundBlackholeSink)) {
Review Comment:
please support NereidsDistributePlanner, the legacy coordinator will be
removed later
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/Queriable.java:
##########
@@ -30,6 +30,8 @@ public interface Queriable {
OutFileClause getOutFileClause();
+ boolean hasBlackHoleClause();
Review Comment:
add comment to explain what is black hole clause
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/PlanType.java:
##########
@@ -60,6 +61,8 @@ public enum PlanType {
LOGICAL_UNBOUND_RESULT_SINK,
LOGICAL_UNBOUND_DICTIONARY_SINK,
+ LOGICAL_UNBOUND_BLACKHOLE_SINK,
Review Comment:
remove L63 (blank line)
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1269,29 +1277,46 @@ public void executeAndSendResult(boolean
isOutfileQuery, boolean isSendFields,
// will be recognized as a success result
// so We need to send fields after first batch arrived
if (!isSendFields) {
- if (!isOutfileQuery) {
- sendFields(queryStmt.getColLabels(),
queryStmt.getFieldInfos(),
- getReturnTypes(queryStmt));
- } else {
+ if (isOutfileQuery) {
if
(!Strings.isNullOrEmpty(queryStmt.getOutFileClause().getSuccessFileName())) {
outfileWriteSuccess(queryStmt.getOutFileClause());
}
sendFields(OutFileClause.RESULT_COL_NAMES,
OutFileClause.RESULT_COL_TYPES);
+ } else if (isBlackHoleClause) {
+ // do nothing
+ } else {
+ sendFields(queryStmt.getColLabels(),
queryStmt.getFieldInfos(),
+ getReturnTypes(queryStmt));
}
isSendFields = true;
}
- for (ByteBuffer row : batch.getBatch().getRows()) {
- channel.sendOnePacket(row);
+ if (isBlackHoleClause) {
+ // For blackhole queries, aggregate data by BE nodes
+ Map<String, String> attachedInfos =
batch.getBatch().getAttachedInfos();
+ if (attachedInfos != null && !attachedInfos.isEmpty())
{
Review Comment:
there are too many if else for BlackHoleSink, maybe we could impl like this:
1. let BlackHoleSink as a abstract class, which could return the customized
header
2. let WarmupSink impl the BlackHoleSink
3. always use one sink instance for WarmupSink, it merge all be's result and
add a line for total
4. remove all if-else for BalckHoleSink because it could work as normal query
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]