HappenLee commented on code in PR #9582:
URL: https://github.com/apache/incubator-doris/pull/9582#discussion_r890833960
##########
be/src/exec/olap_scan_node.cpp:
##########
@@ -630,6 +630,10 @@ Status OlapScanNode::normalize_conjuncts() {
}
case TYPE_DECIMALV2: {
+ // TODO predicate pushdown for decimalv3
+ if (config::enable_execution_decimalv3) {
Review Comment:
the behavior may cause some performance problem ? do we have more great way
to do the thing
##########
be/src/olap/types.h:
##########
@@ -885,6 +900,87 @@ struct FieldTypeTraits<OLAP_FIELD_TYPE_DECIMAL>
}
};
+template <>
+struct FieldTypeTraits<OLAP_FIELD_TYPE_DECIMAL32>
+ : public BaseFieldtypeTraits<OLAP_FIELD_TYPE_DECIMAL32> {
+ static void set_to_max(void* buf) {
+ CppType* data = reinterpret_cast<CppType*>(buf);
+ *data = 999999999;
+ }
+ static void set_to_min(void* buf) {
+ CppType* data = reinterpret_cast<CppType*>(buf);
+ *data = -999999999;
+ }
+};
+
+template <>
+struct FieldTypeTraits<OLAP_FIELD_TYPE_DECIMAL64>
+ : public BaseFieldtypeTraits<OLAP_FIELD_TYPE_DECIMAL64> {
+ static void set_to_max(void* buf) {
+ CppType* data = reinterpret_cast<CppType*>(buf);
+ *data = 999999999999999999ll;
+ }
+ static void set_to_min(void* buf) {
+ CppType* data = reinterpret_cast<CppType*>(buf);
+ *data = -999999999999999999ll;
+ }
+};
+
+template <>
+struct FieldTypeTraits<OLAP_FIELD_TYPE_DECIMAL128>
+ : public BaseFieldtypeTraits<OLAP_FIELD_TYPE_DECIMAL128> {
+ static Status from_string(void* buf, const std::string& scan_key) {
Review Comment:
why do not use `StringParser` to do `string` to `int128`?
##########
be/src/olap/field.h:
##########
@@ -340,6 +345,8 @@ class Field {
uint16_t _index_size;
bool _is_nullable;
std::vector<std::unique_ptr<Field>> _sub_fields;
+ int32_t _precision;
Review Comment:
why use int32_t the `precision` and `_scale` may less than `128` ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]