github-actions[bot] commented on code in PR #15239:
URL: https://github.com/apache/doris/pull/15239#discussion_r1054120628


##########
be/src/vec/runtime/vparquet_writer.cpp:
##########
@@ -36,6 +35,175 @@
 
 namespace doris::vectorized {
 
+ParquetOutputStream::ParquetOutputStream(FileWriter* file_writer)
+        : _file_writer(file_writer), _cur_pos(0), _written_len(0) {
+    set_mode(arrow::io::FileMode::WRITE);
+}
+
+ParquetOutputStream::~ParquetOutputStream() {
+    arrow::Status st = Close();
+    if (!st.ok()) {
+        LOG(WARNING) << "close parquet file error: " << st.ToString();
+    }
+}
+
+arrow::Status ParquetOutputStream::Write(const void* data, int64_t nbytes) {
+    if (_is_closed) {
+        return arrow::Status::OK();
+    }
+    size_t written_len = 0;
+    Status st = _file_writer->write(static_cast<const uint8_t*>(data), nbytes, 
&written_len);
+    if (!st.ok()) {
+        return arrow::Status::IOError(st.to_string());
+    }
+    _cur_pos += written_len;
+    _written_len += written_len;
+    return arrow::Status::OK();
+}
+
+arrow::Result<int64_t> ParquetOutputStream::Tell() const {
+    return _cur_pos;
+}
+
+arrow::Status ParquetOutputStream::Close() {
+    if (_is_closed) {
+        return arrow::Status::OK();
+    }
+    Status st = _file_writer->close();
+    if (!st.ok()) {
+        LOG(WARNING) << "close parquet output stream failed: " << st;
+        return arrow::Status::IOError(st.to_string());
+    }
+    _is_closed = true;
+    return arrow::Status::OK();
+}
+
+int64_t ParquetOutputStream::get_written_len() const {

Review Comment:
   warning: out-of-line definition of 'get_written_len' does not match any 
declaration in 'doris::vectorized::ParquetOutputStream' [clang-diagnostic-error]
   ```cpp
   int64_t ParquetOutputStream::get_written_len() const {
                                ^
   ```
   **be/src/vec/runtime/vparquet_writer.h:55:** member declaration does not 
match because it is not const qualified
   ```cpp
       int64_t get_written_len();
               ^
   ```
   



-- 
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-unsubscr...@doris.apache.org

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