This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 9e3af47 [refactor] comment code converting decimal format (#8708)
9e3af47 is described below
commit 9e3af471e523df4e291f23cd1a0767035461196d
Author: dataroaring <[email protected]>
AuthorDate: Thu Mar 31 12:32:49 2022 +0800
[refactor] comment code converting decimal format (#8708)
The comment can help newbies read code much more quickly.
---
be/src/exec/olap_scanner.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/be/src/exec/olap_scanner.cpp b/be/src/exec/olap_scanner.cpp
index 3a675d0..fcacd22 100644
--- a/be/src/exec/olap_scanner.cpp
+++ b/be/src/exec/olap_scanner.cpp
@@ -458,6 +458,9 @@ void OlapScanner::_convert_row_to_tuple(Tuple* tuple) {
DecimalV2Value* slot =
tuple->get_decimalv2_slot(slot_desc->tuple_offset());
auto packed_decimal = *reinterpret_cast<const decimal12_t*>(ptr);
+ // We convert the format for storage to the format for computation.
+ // Coding coverting in the opposite direction is in
AggregateFuncTraits
+ // for decimal.
int64_t int_value = packed_decimal.integer;
int32_t frac_value = packed_decimal.fraction;
if (!slot->from_olap_decimal(int_value, frac_value)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]