wangbo commented on a change in pull request #6270: URL: https://github.com/apache/incubator-doris/pull/6270#discussion_r688195122
########## File path: be/src/olap/push_handler.cpp ########## @@ -971,6 +971,70 @@ OLAPStatus PushBrokerReader::init(const Schema* schema, const TBrokerScanRange& return OLAP_SUCCESS; } +OLAPStatus PushBrokerReader::fill_field_row(RowCursorCell* dst, const char* src, bool src_null, MemPool* mem_pool, FieldType type){ + switch (type) { + case OLAP_FIELD_TYPE_DECIMAL: { + dst->set_is_null(src_null); + if (src_null) { + break; + } + auto *decimal_value = reinterpret_cast<const DecimalV2Value *>(src); + auto *storage_decimal_value = reinterpret_cast<decimal12_t *>(dst->mutable_cell_ptr()); + storage_decimal_value->integer = decimal_value->int_value(); + storage_decimal_value->fraction = decimal_value->frac_value(); + break; + } + case OLAP_FIELD_TYPE_DATETIME: { + dst->set_is_null(src_null); + if (src_null) { + break; + } + + auto* datetime_value = reinterpret_cast<const DateTimeValue*>(src); + auto* storage_datetime_value = reinterpret_cast<uint64_t*>(dst->mutable_cell_ptr()); + *storage_datetime_value = datetime_value->to_olap_datetime(); + break; + } + + case OLAP_FIELD_TYPE_DATE: { + dst->set_is_null(src_null); + if (src_null) { + break; + } + + auto* date_value = reinterpret_cast<const DateTimeValue*>(src); + auto* storage_date_value = reinterpret_cast<uint24_t*>(dst->mutable_cell_ptr()); + *storage_date_value = static_cast<int64_t>(date_value->to_olap_date()); + break; + } + case OLAP_FIELD_TYPE_BOOL: + case OLAP_FIELD_TYPE_TINYINT: + case OLAP_FIELD_TYPE_SMALLINT: + case OLAP_FIELD_TYPE_INT: + case OLAP_FIELD_TYPE_UNSIGNED_INT: + case OLAP_FIELD_TYPE_BIGINT: + case OLAP_FIELD_TYPE_LARGEINT: + case OLAP_FIELD_TYPE_FLOAT: + case OLAP_FIELD_TYPE_DOUBLE: + case OLAP_FIELD_TYPE_CHAR: + case OLAP_FIELD_TYPE_VARCHAR: + case OLAP_FIELD_TYPE_HLL: + case OLAP_FIELD_TYPE_OBJECT:{ + dst->set_is_null(src_null); + if (src_null) { + break; + } + const TypeInfo* _type_info = get_type_info(type); Review comment: ```_type_info``` is not a Class member field, so don't use underscore as prefix. ```suggestion const TypeInfo* type_info = get_type_info(type); ``` -- 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