imay commented on a change in pull request #2310: Marising
URL: https://github.com/apache/incubator-doris/pull/2310#discussion_r351169060
##########
File path: be/src/olap/schema_change.cpp
##########
@@ -335,12 +336,36 @@ bool RowBlockChanger::change_row_block(
write_helper.set_field_content(i, buf, mem_pool);
}
}
-
+ } else if ( (newtype == OLAP_FIELD_TYPE_DATE && reftype ==
OLAP_FIELD_TYPE_DATETIME)
+ || (newtype == OLAP_FIELD_TYPE_DOUBLE && reftype ==
OLAP_FIELD_TYPE_FLOAT) ) {
+ // 效率低下,也可以直接计算变长域拷贝,但仍然会破坏封装
+ 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 ( read_helper.is_null(ref_column) ) {
+ write_helper.set_null(i);
+ }else{
Review comment:
```suggestion
} else {
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]