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 2022/02/25 06:29:21 UTC
[GitHub] [incubator-doris] adonis0147 opened a new pull request #8240: [feature-wip][array-type] Refactor type info for nested array.
adonis0147 opened a new pull request #8240:
URL: https://github.com/apache/incubator-doris/pull/8240
# Proposed changes
Issue Number: close #8237
## Problem Summary:
Please refer to #8237 .
## Checklist(Required)
1. Does it affect the original behavior: No
2. Has unit tests been added: No Need
3. Has document been added or modified: No Need
4. Does it need to update dependencies: No
5. Are there any changes that cannot be rolled back: No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
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
[GitHub] [incubator-doris] morningman commented on pull request #8240: [feature-wip][array-type] Refactor type info for nested array.
Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #8240:
URL: https://github.com/apache/incubator-doris/pull/8240#issuecomment-1056344993
close this PR, #8279 will be cherry-picked to array-type branch
--
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
[GitHub] [incubator-doris] morningman commented on a change in pull request #8240: [feature-wip][array-type] Refactor type info for nested array.
Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #8240:
URL: https://github.com/apache/incubator-doris/pull/8240#discussion_r816456289
##########
File path: be/src/olap/types.cpp
##########
@@ -97,30 +98,51 @@ bool is_scalar_type(FieldType field_type) {
}
}
-TypeInfo* get_scalar_type_info(FieldType field_type) {
+std::shared_ptr<const TypeInfo> get_scalar_type_info(FieldType field_type) {
return ScalarTypeInfoResolver::instance()->get_type_info(field_type);
}
class ArrayTypeInfoResolver {
DECLARE_SINGLETON(ArrayTypeInfoResolver);
public:
- TypeInfo* get_type_info(const FieldType t) {
+ std::shared_ptr<const TypeInfo> get_type_info(const FieldType t) {
auto pair = _type_mapping.find(t);
DCHECK(pair != _type_mapping.end()) << "Bad field type: list<" << t << ">";
- return pair->second.get();
+ return pair->second;
+ }
+
+ std::shared_ptr<const TypeInfo> get_type_info(const TabletColumn& column) {
+ DCHECK(column.get_subtype_count() == 1) << "more than 1 child type.";
+ const auto &sub_column = column.get_sub_column(0);
+ if (is_scalar_type(sub_column.type())) {
+ return get_type_info(sub_column.type());
+ } else {
+ return std::shared_ptr<const TypeInfo>(new ArrayTypeInfo(get_type_info(sub_column)));
Review comment:
```suggestion
return std::make_shared<const ArrayTypeInfo>(get_type_info(sub_column));
```
##########
File path: be/src/olap/types.cpp
##########
@@ -97,30 +98,51 @@ bool is_scalar_type(FieldType field_type) {
}
}
-TypeInfo* get_scalar_type_info(FieldType field_type) {
+std::shared_ptr<const TypeInfo> get_scalar_type_info(FieldType field_type) {
return ScalarTypeInfoResolver::instance()->get_type_info(field_type);
}
class ArrayTypeInfoResolver {
DECLARE_SINGLETON(ArrayTypeInfoResolver);
public:
- TypeInfo* get_type_info(const FieldType t) {
+ std::shared_ptr<const TypeInfo> get_type_info(const FieldType t) {
auto pair = _type_mapping.find(t);
DCHECK(pair != _type_mapping.end()) << "Bad field type: list<" << t << ">";
- return pair->second.get();
+ return pair->second;
+ }
+
+ std::shared_ptr<const TypeInfo> get_type_info(const TabletColumn& column) {
+ DCHECK(column.get_subtype_count() == 1) << "more than 1 child type.";
+ const auto &sub_column = column.get_sub_column(0);
+ if (is_scalar_type(sub_column.type())) {
+ return get_type_info(sub_column.type());
+ } else {
+ return std::shared_ptr<const TypeInfo>(new ArrayTypeInfo(get_type_info(sub_column)));
+ }
+ }
+
+ std::shared_ptr<const TypeInfo> get_type_info(const segment_v2::ColumnMetaPB& column_meta_pb) {
+ DCHECK(column_meta_pb.children_columns_size() >= 1 && column_meta_pb.children_columns_size() <= 3)
+ << "more than 3 children or no children.";
+ const auto& child_type = column_meta_pb.children_columns(0);
+ if (is_scalar_type((FieldType)child_type.type())) {
+ return get_type_info((FieldType)child_type.type());
+ } else {
+ return std::shared_ptr<const TypeInfo>(new ArrayTypeInfo(get_type_info(child_type)));
Review comment:
```suggestion
return std::make_shared<const ArrayTypeInfo>(get_type_info(child_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-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
[GitHub] [incubator-doris] morningman closed pull request #8240: [feature-wip][array-type] Refactor type info for nested array.
Posted by GitBox <gi...@apache.org>.
morningman closed pull request #8240:
URL: https://github.com/apache/incubator-doris/pull/8240
--
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