morningman commented on a change in pull request #3584:
URL: https://github.com/apache/incubator-doris/pull/3584#discussion_r428444409



##########
File path: be/src/runtime/file_result_writer.h
##########
@@ -0,0 +1,132 @@
+// 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.
+
+#pragma once
+
+#include "runtime/result_writer.h"
+#include "runtime/runtime_state.h"
+#include "gen_cpp/DataSinks_types.h"
+
+namespace doris {
+
+class ExprContext;
+class FileWriter;
+class ParquetWriterWrapper;
+class RowBatch;
+class RuntimeProfile;
+class TupleRow;
+
+struct ResultFileOptions {
+    bool is_local_file;
+    std::string file_path;
+    TFileFormatType::type file_format;
+    std::string column_separator;
+    std::string line_delimiter;
+    size_t max_file_size_bytes = 1 * 1024 * 1024 * 1024; // 1GB
+    std::vector<TNetworkAddress> broker_addresses;
+    std::map<std::string, std::string> broker_properties;
+
+    ResultFileOptions(const TResultFileSinkOptions& t_opt) {
+        file_path = t_opt.file_path;
+        file_format = t_opt.file_format;
+        column_separator = t_opt.__isset.column_separator ? 
t_opt.column_separator : "\t";
+        line_delimiter = t_opt.__isset.line_delimiter ? t_opt.line_delimiter : 
"\n";
+        max_file_size_bytes = t_opt.__isset.max_file_size_bytes ?
+                t_opt.max_file_size_bytes : max_file_size_bytes;
+
+        is_local_file = true;
+        if (t_opt.__isset.broker_addresses) {
+            broker_addresses = t_opt.broker_addresses;
+            is_local_file = false;
+        }
+        if (t_opt.__isset.broker_properties) {
+            broker_properties = t_opt.broker_properties;
+        }
+    }
+};
+
+// write result to file
+class FileResultWriter : public ResultWriter {

Review comment:
       OK




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

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



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

Reply via email to