gaodayue commented on a change in pull request #3025: Restructure storage type 
to support complex types expending
URL: https://github.com/apache/incubator-doris/pull/3025#discussion_r395061622
 
 

 ##########
 File path: be/src/olap/row_block2.cpp
 ##########
 @@ -29,30 +29,21 @@ namespace doris {
 RowBlockV2::RowBlockV2(const Schema& schema, uint16_t capacity)
     : _schema(schema),
       _capacity(capacity),
-      _column_datas(_schema.num_columns(), nullptr),
-      _column_null_bitmaps(_schema.num_columns(), nullptr),
+      _column_vector_batches(_schema.num_columns()),
       _pool(new MemPool(&_tracker)),
       _selection_vector(nullptr) {
-    auto bitmap_size = BitmapSize(capacity);
     for (auto cid : _schema.column_ids()) {
-        size_t data_size = _schema.column(cid)->type_info()->size() * 
_capacity;
-        _column_datas[cid] = new uint8_t[data_size];
-
-        if (_schema.column(cid)->is_nullable()) {
-            _column_null_bitmaps[cid] = new uint8_t[bitmap_size];;
-        }
+        ColumnVectorBatch::create(
+                _capacity,
+                _schema.column(cid)->is_nullable(),
+                _schema.column(cid)->type_info(),
+                &_column_vector_batches[cid]);
 
 Review comment:
   shoud CHECK the return value so that we can detect BUG early

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


With regards,
Apache Git Services

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

Reply via email to