imay commented on a change in pull request #697: Optimize decimal by 
introducing decimal_v2 (#695)
URL: https://github.com/apache/incubator-doris/pull/697#discussion_r263638965
 
 

 ##########
 File path: be/src/exec/olap_scanner.cpp
 ##########
 @@ -385,6 +385,15 @@ void OlapScanner::_convert_row_to_tuple(Tuple* tuple) {
             *slot = DecimalValue(int_value, frac_value);
             break;
         }
+        case TYPE_DECIMALV2: {
+            DecimalV2Value *slot = 
tuple->get_decimalv2_slot(slot_desc->tuple_offset());
+
+            // TODO(lingbin): should remove this assign, use set member 
function
+            int64_t int_value = *(int64_t*)(ptr);
+            int32_t frac_value = *(int32_t*)(ptr + sizeof(int64_t));
+            *slot = DecimalV2Value(int_value, frac_value);
 
 Review comment:
   can you add a `from_olap_decimal` function to avoid copy?

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

Reply via email to