decster commented on a change in pull request #3580:
URL: https://github.com/apache/incubator-doris/pull/3580#discussion_r426449095



##########
File path: be/src/olap/memory/column_writer.h
##########
@@ -0,0 +1,81 @@
+// 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 "olap/memory/common.h"
+
+namespace doris {
+namespace memory {
+
+class Column;
+
+// Exclusive writer for column, also with some reader's functionality
+//
+// Example writer usage:
+//   scoped_refptr<Column> column;
+//   std::unique_ptr<ColumnWriter> writer;
+//   // create writer
+//   RETURN_IF_ERROR(column->create_writer(&writer).ok());
+//   writer->insert(new_rowid, &value);
+//   writer->update(rowid, &value);
+//   writer->finalize(new_version);
+//   // get new column refptr
+//   // if a COW has been done, column will point to new column object
+//   // else column will remain the same.
+//   writer->get_new_column(&column);
+class ColumnWriter {
+public:
+    virtual ~ColumnWriter() {}
+
+    // Get cell by rid, caller needs to make sure rid is in valid range
+    //
+    // Note: this is the same method as ColumnReader::get
+    virtual const void* get(const uint32_t rid) const = 0;

Review comment:
       fixed




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to