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 2021/08/16 06:15:14 UTC

[GitHub] [incubator-doris] spaces-X commented on a change in pull request #6270: [Improvement] spark load without agg and de/serialization

spaces-X commented on a change in pull request #6270:
URL: https://github.com/apache/incubator-doris/pull/6270#discussion_r689262365



##########
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:
       done

##########
File path: be/src/olap/push_handler.h
##########
@@ -190,6 +190,7 @@ class PushBrokerReader {
     OLAPStatus init(const Schema* schema, const TBrokerScanRange& t_scan_range,
                     const TDescriptorTable& t_desc_tbl);
     OLAPStatus next(ContiguousRow* row);
+    OLAPStatus fill_field_row(RowCursorCell* dst, const char* src,bool src_null, MemPool* mem_pool, FieldType type);

Review comment:
       done




-- 
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-unsubscribe@doris.apache.org

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