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 2021/08/31 15:30:01 UTC

[GitHub] [incubator-doris] EmmyMiao87 opened a new pull request #6539: Support concurrent export of query results

EmmyMiao87 opened a new pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539


   ## Proposed changes
   
   This pr mainly supports
   1. Export query result sets concurrently
   2. Query result set export supports s3 protocol
   
   Among them, there are several preconditions for concurrently exporting query result sets
   1. Enable concurrent export variables
   2. The query itself can be exported concurrently
       (some queries containing sort nodes at the top level cannot be exported concurrently)
   3. Export the s3 protocol used instead of the broker
   
   After exporting the result set concurrently,
   the file prefix is changed to outfile_{query_instance_id}_filenumber.{file_format}
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [x] New feature (non-breaking change which adds functionality)
   - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [x] Code refactor (Modify the code structure, format the code, etc...)
   - [ ] Optimization. Including functional usability improvements and performance improvements.
   - [ ] Dependency. Such as changes related to third-party components.
   - [ ] Other.
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [ ] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   


-- 
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] [incubator-doris] EmmyMiao87 commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r699998628



##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       In order to be compatible with the old version of Fe and the new version of be

##########
File path: be/src/runtime/file_result_writer.h
##########
@@ -31,6 +32,7 @@ class RuntimeProfile;
 class TupleRow;
 
 struct ResultFileOptions {
+    // deprecated
     bool is_local_file;

Review comment:
       For compatible 




-- 
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] [incubator-doris] morningman merged pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539


   


-- 
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] [incubator-doris] EmmyMiao87 commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r700721088



##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       It's not easy to add, there will be compatibility issues




-- 
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] [incubator-doris] EmmyMiao87 commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r699998628



##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       In order to be compatible with the old version of Fe and the new version of be

##########
File path: be/src/runtime/file_result_writer.h
##########
@@ -31,6 +32,7 @@ class RuntimeProfile;
 class TupleRow;
 
 struct ResultFileOptions {
+    // deprecated
     bool is_local_file;

Review comment:
       For compatible 




-- 
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] [incubator-doris] github-actions[bot] commented on pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#issuecomment-913315415


   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] [incubator-doris] morningman commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r699833595



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/OutFileClause.java
##########
@@ -45,6 +48,8 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.apache.doris.backup.S3Storage.S3_PROPERTIES_PREFIX;

Review comment:
       remove static import

##########
File path: be/src/exec/data_sink.cpp
##########
@@ -78,14 +80,29 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
         }
         sink->reset(tmp_sink);
         break;
-    case TDataSinkType::MEMORY_SCRATCH_SINK:
+    }
+    case TDataSinkType::RESULT_FILE_SINK: {
+        if (!thrift_sink.__isset.result_file_sink) {
+            return Status::InternalError("Missing result file sink.");
+        }
+        if (params.__isset.destinations && params.destinations.size() > 0) {

Review comment:
       Add comments

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/Planner.java
##########
@@ -298,9 +285,76 @@ private PlanNode addUnassignedConjuncts(Analyzer analyzer, PlanNode root)
         return selectNode;
     }
 
+    private void pushDownResultFileSink(Analyzer analyzer) {

Review comment:
       Add some comments?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/ExchangeNode.java
##########
@@ -78,6 +78,13 @@ public ExchangeNode(PlanNodeId id, PlanNode inputNode, boolean copyConjuncts) {
         computeTupleIds();
     }
 
+    public boolean isMergingExchange() {
+        if (planNodeName.equals(MERGING_EXCHANGE_NODE)) {

Review comment:
       Use `mergeInfo` to check it better?

##########
File path: be/src/runtime/file_result_writer.h
##########
@@ -31,6 +32,7 @@ class RuntimeProfile;
 class TupleRow;
 
 struct ResultFileOptions {
+    // deprecated
     bool is_local_file;

Review comment:
       Why not delete it?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
##########
@@ -771,12 +774,17 @@ public boolean isExtractWideRangeExpr() {
         return extractWideRangeExpr;
     }
 
+<<<<<<< HEAD

Review comment:
       ??

##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -392,7 +454,8 @@ Status FileResultWriter::close() {
     // so does the profile in RuntimeState.
     COUNTER_SET(_written_rows_counter, _written_rows);
     SCOPED_TIMER(_writer_close_timer);
-    return _close_file_writer(true);
+    RETURN_IF_ERROR(_close_file_writer(true, false));

Review comment:
       just return

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/Planner.java
##########
@@ -298,9 +285,76 @@ private PlanNode addUnassignedConjuncts(Analyzer analyzer, PlanNode root)
         return selectNode;
     }
 
+    private void pushDownResultFileSink(Analyzer analyzer) {
+        if (fragments.size() < 1) {
+            return;
+        }
+        if (!(fragments.get(0).getSink() instanceof ResultFileSink)) {
+            return;
+        }
+        if (!ConnectContext.get().getSessionVariable().isEnableParallelOutfile()) {
+            return;
+        }
+        if (!(fragments.get(0).getPlanRoot() instanceof ExchangeNode)) {
+            return;
+        }
+        PlanFragment topPlanFragment = fragments.get(0);
+        ExchangeNode topPlanNode = (ExchangeNode) topPlanFragment.getPlanRoot();
+        // try to push down result file sink
+        if (topPlanNode.isMergingExchange()) {
+            return;
+        }
+        PlanFragment secondPlanFragment = fragments.get(1);
+        ResultFileSink resultFileSink = (ResultFileSink) topPlanFragment.getSink();
+        if (resultFileSink.getStorageType() == StorageBackend.StorageType.BROKER) {
+            return;
+        }
+        if (secondPlanFragment.getOutputExprs() != null) {
+            return;
+        }
+        // create result file sink desc
+        TupleDescriptor fileStatusDesc = constructFileStatusTupleDesc(analyzer);
+        resultFileSink.resetByDataStreamSink((DataStreamSink) secondPlanFragment.getSink());
+        resultFileSink.setOutputTupleId(fileStatusDesc.getId());
+        secondPlanFragment.setOutputExprs(topPlanFragment.getOutputExprs());
+        secondPlanFragment.resetSink(resultFileSink);
+        ResultSink resultSink = new ResultSink(topPlanNode.getId());
+        topPlanFragment.resetSink(resultSink);
+        topPlanFragment.resetOutputExprs(fileStatusDesc);
+        topPlanFragment.getPlanRoot().resetTupleIds(Lists.newArrayList(fileStatusDesc.getId()));
+    }
+
+    private TupleDescriptor constructFileStatusTupleDesc(Analyzer analyzer) {

Review comment:
       Add some comments

##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       What's this?




-- 
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] [incubator-doris] morningman commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r700356119



##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       Add comment to explain.
   
   BTW, I suggest to add `FileNamePrefix` column in the result of outfile operation. For easy to get full name of exported files. Such as:
   
   ```
   +------------+-----------+-----------+-------------+------------------------------------------+
   | FileNumber | TotalRows | FileSize  | URL         |FileNamePrefix                            |
   +------------+-----------+-----------+-------------+------------------------------------------+
   |          1 |    123605 | 361061014 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10325|
   |          1 |    128180 | 374334318 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10326|
   |          1 |    125156 | 365569023 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10327|
   |          1 |    124096 | 362395588 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10328|
   |          1 |    124862 | 364727515 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10329|
   |          1 |    124520 | 363649600 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10330|
   |          1 |    124447 | 363479285 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10331|
   |          1 |    125134 | 365490611 | 127.0.0.1   |my_file2_46e9ef9b66924a79-92f887d43be10332|
   +------------+-----------+-----------+-------------+------------------------------------------+
   ```




-- 
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] [incubator-doris] github-actions[bot] commented on pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#issuecomment-913299631






-- 
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] [incubator-doris] morningman commented on a change in pull request #6539: Support concurrent export of query results

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6539:
URL: https://github.com/apache/incubator-doris/pull/6539#discussion_r699833595



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/OutFileClause.java
##########
@@ -45,6 +48,8 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.apache.doris.backup.S3Storage.S3_PROPERTIES_PREFIX;

Review comment:
       remove static import

##########
File path: be/src/exec/data_sink.cpp
##########
@@ -78,14 +80,29 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
         }
         sink->reset(tmp_sink);
         break;
-    case TDataSinkType::MEMORY_SCRATCH_SINK:
+    }
+    case TDataSinkType::RESULT_FILE_SINK: {
+        if (!thrift_sink.__isset.result_file_sink) {
+            return Status::InternalError("Missing result file sink.");
+        }
+        if (params.__isset.destinations && params.destinations.size() > 0) {

Review comment:
       Add comments

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/Planner.java
##########
@@ -298,9 +285,76 @@ private PlanNode addUnassignedConjuncts(Analyzer analyzer, PlanNode root)
         return selectNode;
     }
 
+    private void pushDownResultFileSink(Analyzer analyzer) {

Review comment:
       Add some comments?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/ExchangeNode.java
##########
@@ -78,6 +78,13 @@ public ExchangeNode(PlanNodeId id, PlanNode inputNode, boolean copyConjuncts) {
         computeTupleIds();
     }
 
+    public boolean isMergingExchange() {
+        if (planNodeName.equals(MERGING_EXCHANGE_NODE)) {

Review comment:
       Use `mergeInfo` to check it better?

##########
File path: be/src/runtime/file_result_writer.h
##########
@@ -31,6 +32,7 @@ class RuntimeProfile;
 class TupleRow;
 
 struct ResultFileOptions {
+    // deprecated
     bool is_local_file;

Review comment:
       Why not delete it?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
##########
@@ -771,12 +774,17 @@ public boolean isExtractWideRangeExpr() {
         return extractWideRangeExpr;
     }
 
+<<<<<<< HEAD

Review comment:
       ??

##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -392,7 +454,8 @@ Status FileResultWriter::close() {
     // so does the profile in RuntimeState.
     COUNTER_SET(_written_rows_counter, _written_rows);
     SCOPED_TIMER(_writer_close_timer);
-    return _close_file_writer(true);
+    RETURN_IF_ERROR(_close_file_writer(true, false));

Review comment:
       just return

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/Planner.java
##########
@@ -298,9 +285,76 @@ private PlanNode addUnassignedConjuncts(Analyzer analyzer, PlanNode root)
         return selectNode;
     }
 
+    private void pushDownResultFileSink(Analyzer analyzer) {
+        if (fragments.size() < 1) {
+            return;
+        }
+        if (!(fragments.get(0).getSink() instanceof ResultFileSink)) {
+            return;
+        }
+        if (!ConnectContext.get().getSessionVariable().isEnableParallelOutfile()) {
+            return;
+        }
+        if (!(fragments.get(0).getPlanRoot() instanceof ExchangeNode)) {
+            return;
+        }
+        PlanFragment topPlanFragment = fragments.get(0);
+        ExchangeNode topPlanNode = (ExchangeNode) topPlanFragment.getPlanRoot();
+        // try to push down result file sink
+        if (topPlanNode.isMergingExchange()) {
+            return;
+        }
+        PlanFragment secondPlanFragment = fragments.get(1);
+        ResultFileSink resultFileSink = (ResultFileSink) topPlanFragment.getSink();
+        if (resultFileSink.getStorageType() == StorageBackend.StorageType.BROKER) {
+            return;
+        }
+        if (secondPlanFragment.getOutputExprs() != null) {
+            return;
+        }
+        // create result file sink desc
+        TupleDescriptor fileStatusDesc = constructFileStatusTupleDesc(analyzer);
+        resultFileSink.resetByDataStreamSink((DataStreamSink) secondPlanFragment.getSink());
+        resultFileSink.setOutputTupleId(fileStatusDesc.getId());
+        secondPlanFragment.setOutputExprs(topPlanFragment.getOutputExprs());
+        secondPlanFragment.resetSink(resultFileSink);
+        ResultSink resultSink = new ResultSink(topPlanNode.getId());
+        topPlanFragment.resetSink(resultSink);
+        topPlanFragment.resetOutputExprs(fileStatusDesc);
+        topPlanFragment.getPlanRoot().resetTupleIds(Lists.newArrayList(fileStatusDesc.getId()));
+    }
+
+    private TupleDescriptor constructFileStatusTupleDesc(Analyzer analyzer) {

Review comment:
       Add some comments

##########
File path: be/src/runtime/file_result_writer.cpp
##########
@@ -39,13 +42,36 @@ namespace doris {
 
 const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
 
+// deprecated
 FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
                                    const std::vector<ExprContext*>& output_expr_ctxs,
                                    RuntimeProfile* parent_profile, BufferControlBlock* sinker)
         : _file_opts(file_opts),
           _output_expr_ctxs(output_expr_ctxs),
           _parent_profile(parent_profile),
-          _sinker(sinker) {}
+          _sinker(sinker) {
+        if (_file_opts->is_local_file) {
+            _storage_type = TStorageBackendType::LOCAL;
+        } else {
+            _storage_type = TStorageBackendType::BROKER;
+        }
+        _fragment_instance_id.hi = 12345678987654321;

Review comment:
       What's this?




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