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 2020/06/10 10:48:15 UTC

[GitHub] [incubator-doris] HangyuanLiu commented on a change in pull request #3739: Support materialized view schema change

HangyuanLiu commented on a change in pull request #3739:
URL: https://github.com/apache/incubator-doris/pull/3739#discussion_r438032236



##########
File path: be/src/olap/schema_change.cpp
##########
@@ -266,6 +260,92 @@ bool RowBlockChanger::change_row_block(
         int32_t ref_column = _schema_mapping[i].ref_column;
 
         if (_schema_mapping[i].ref_column >= 0) {
+            if (!_schema_mapping[i].materialized_function.empty()) {
+                VLOG(3) << "_schema_mapping[" << i << "].materialized_function : " << _schema_mapping[i].materialized_function;
+                // 效率低下,也可以直接计算变长域拷贝,但仍然会破坏封装
+                for (size_t row_index = 0, new_row_index = 0;
+                     row_index < ref_block->row_block_info().row_num; ++row_index) {
+                    // 不需要的row,每次处理到这个row时就跳过
+                    if (need_filter_data && is_data_left_vec[row_index] == 0) {
+                        continue;
+                    }
+
+                    // 指定新的要写入的row index(不同于读的row_index)
+                    mutable_block->get_row(new_row_index++, &write_helper);
+                    ref_block->get_row(row_index, &read_helper);
+
+                    if (_schema_mapping[i].materialized_function == "to_bitmap") {
+                        write_helper.set_not_null(i);
+                        BitmapValue bitmap;
+                        if (!read_helper.is_null(ref_column)) {

Review comment:
       the result of to_bitmap or hll_hash always not null




----------------------------------------------------------------
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:
users@infra.apache.org



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