Skip to content

[Feature](map) add map type to doris - #15966

Merged
xy720 merged 12 commits into
apache:struct-typefrom
amorynan:feature-map
Feb 3, 2023
Merged

[Feature](map) add map type to doris#15966
xy720 merged 12 commits into
apache:struct-typefrom
amorynan:feature-map

Conversation

@amorynan

@amorynanamorynan commented Jan 16, 2023

Copy link
Copy Markdown
Contributor

Proposed changes

TO support doris complex type for map
Issue Number: close #xxx

Problem summary

Describe your changes.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actionsgithub-actionsBot added area/planner Issues or PRs related to the query planner area/sql/function Issues or PRs related to the SQL functions area/vectorization labels Jan 16, 2023

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp
Comment threadbe/src/runtime/map_value.h Outdated
Comment on lines +124 to +125
if (!keys->equals(*rhs_map.keys))
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
if (!keys->equals(*rhs_map.keys))
returnfalse;
if (!keys->equals(*rhs_map.keys)) {
returnfalse;
}

Comment threadbe/src/vec/data_types/data_type_map.cpp Outdated
Comment threadbe/src/vec/exprs/vmap_literal.cpp Outdated
Comment threadbe/src/vec/exprs/vmap_literal.cpp Outdated
Comment threadbe/src/vec/functions/array/function_array_element.h Outdated
@amorynan
amorynan changed the base branch from master to struct-typeJanuary 16, 2023 10:05
@morningman

Copy link
Copy Markdown
Contributor

Please change the title and rebase the code

Comment threadbe/src/olap/field.h Outdated
@amorynanamorynan changed the title feature-map[Feature](map)support complex struct for dorisJan 17, 2023

@xiaokangxiaokang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fe reviewed

Comment threadfe/fe-core/src/main/java/org/apache/doris/catalog/Column.java Outdated
Comment threadfe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java Outdated
Comment threadfe/fe-core/src/main/java/org/apache/doris/mysql/MysqlColType.java Outdated
Comment threadfe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java Outdated
Comment threadbe/src/vec/data_types/data_type_map.cpp Outdated
Comment threadbe/src/vec/data_types/data_type_map.cpp
Comment threadbe/src/vec/data_types/data_type_map.cpp Outdated

@xiaokangxiaokang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be code reviewed

Comment threadbe/src/vec/data_types/data_type_factory.hpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp Outdated
Comment threadbe/src/vec/columns/column_map.cpp Outdated
Comment threadbe/src/vec/columns/column_map.cpp Outdated
Comment threadbe/src/vec/columns/column_map.cpp
Comment threadbe/src/vec/functions/array/function_array_element.h Outdated
Comment threadbe/src/vec/functions/array/function_array_element.h Outdated
Comment threadbe/src/vec/functions/array/function_array_element.h Outdated
Comment threadbe/src/vec/functions/array/function_array_element.h Outdated
Comment threadbe/src/vec/sink/vmysql_result_writer.cpp
Comment threadbe/src/olap/rowset/segment_v2/column_reader.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_reader.h Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_reader.h
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/olap/types.h Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_writer.cpp Outdated
Comment threadbe/src/vec/columns/column_map.h
Comment threadbe/src/vec/columns/column_map.h
Comment threadbe/src/vec/core/field.h
Comment threadfe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java Outdated
Comment threadfe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java Outdated
Comment threadfe/fe-core/src/main/java/org/apache/doris/catalog/Column.java Outdated
@amorynan
amorynan requested review from xiaokang and xy720 and removed request for xiaokangJanuary 29, 2023 07:38

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadbe/src/olap/rowset/segment_v2/column_reader.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_reader.cpp Outdated
Comment threadbe/src/runtime/map_value.h Outdated
Comment threadbe/src/runtime/map_value.h Outdated
Comment threadbe/src/udf/udf.h Outdated
Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadbe/src/runtime/types.cpp Outdated
Comment threadbe/src/runtime/types.cpp Outdated
Comment threadbe/src/vec/data_types/data_type_factory.cpp Outdated
Comment threadbe/src/vec/data_types/data_type_factory.cpp Outdated
Comment threadbe/src/vec/data_types/data_type_factory.cpp Outdated
Comment threadbe/src/vec/sink/vmysql_result_writer.cpp Outdated
Comment threadbe/src/vec/sink/vmysql_result_writer.cpp Outdated
Comment threadbe/src/vec/sink/vmysql_result_writer.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_reader.cpp Outdated
Comment threadbe/src/olap/rowset/segment_v2/column_reader.cpp Outdated
Comment threadbe/src/olap/types.h Outdated
Comment threadbe/src/runtime/types.cpp Outdated
Comment threadbe/src/vec/olap/olap_data_convertor.cpp Outdated
Comment threadbe/src/vec/sink/vmysql_result_writer.cpp Outdated
@amorynan
amorynan requested review from xiaokang and removed request for xiaokangFebruary 1, 2023 10:48

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 27. Check the log or trigger a new build to see more.

Comment threadbe/src/runtime/types.cpp
Comment threadbe/src/runtime/types.cpp
Comment threadbe/src/runtime/types.cpp
Comment threadbe/src/runtime/types.cpp
create_data_type(col_desc.children[1], col_desc.contains_nulls[1]));
break;
}
case INVALID_TYPE:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'case' statement not in switch statement [clang-diagnostic-error]

caseINVALID_TYPE:
^

for (int i = 0; i < _children.size(); ++i) {
if (!_children[i]->is_constant()) {
return false;
std::string VExpr::debug_string(const std::vector<VExprContext*>& ctxs) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function definition is not allowed here [clang-diagnostic-error]

 std::string VExpr::debug_string(const std::vector<VExprContext*>& ctxs) {
^


return true;
}
bool VExpr::is_constant() const {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function definition is not allowed here [clang-diagnostic-error]

boolVExpr::is_constant() const {
^

}

if (_constant_col != nullptr) {
Status VExpr::get_const_col(VExprContext * context, ColumnPtrWrapper * *output) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function definition is not allowed here [clang-diagnostic-error]

 Status VExpr::get_const_col(VExprContext * context, ColumnPtrWrapper * *output) {
^

Comment threadbe/src/vec/exprs/vexpr.cpp
Comment threadbe/src/vec/exprs/vexpr.cpp
return Status::OK();
}

Status VExpr::create_tree_from_thrift(doris::ObjectPool* pool,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why modify here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I use clang-format.sh , it make these change...

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadbe/src/vec/data_types/data_type_factory.cpp
Comment threadbe/src/vec/data_types/data_type_factory.cpp
@amorynanamorynan changed the title [Feature](map)support complex struct for doris[Feature](map) add map type to dorisFeb 2, 2023
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@amorynan
amorynan requested review from xy720 and removed request for xiaokang and xy720February 2, 2023 14:50

@xy720xy720 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Feb 3, 2023
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@xy720
xy720 merged commit af9234b into apache:struct-typeFeb 3, 2023
xy720 pushed a commit that referenced this pull request Feb 6, 2023
Add complex type map to doris on vectorized engine
xy720 pushed a commit that referenced this pull request Feb 9, 2023
Add complex type map to doris on vectorized engine
xy720 pushed a commit that referenced this pull request Feb 9, 2023
Add complex type map to doris on vectorized engine
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.area/plannerIssues or PRs related to the query plannerarea/sql/functionIssues or PRs related to the SQL functionsarea/vectorizationreviewed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

@amorynan@morningman@xiaokang@carlvinhust2012@xy720