-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Revert "[Coverage](BE) Delete vinfo_func in BE" #26723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zhangstar333
merged 1 commit into
apache:master
from
zclllyybb:revert-26562-delete_info
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||
| // Licensed to the Apache Software Foundation (ASF) under one | ||||||||
| // or more contributor license agreements. See the NOTICE file | ||||||||
| // distributed with this work for additional information | ||||||||
| // regarding copyright ownership. The ASF licenses this file | ||||||||
| // to you under the Apache License, Version 2.0 (the | ||||||||
| // "License"); you may not use this file except in compliance | ||||||||
| // with the License. You may obtain a copy of the License at | ||||||||
| // | ||||||||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||||||||
| // | ||||||||
| // Unless required by applicable law or agreed to in writing, | ||||||||
| // software distributed under the License is distributed on an | ||||||||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||||||||
| // KIND, either express or implied. See the License for the | ||||||||
| // specific language governing permissions and limitations | ||||||||
| // under the License. | ||||||||
|
|
||||||||
| #include "vec/exprs/vinfo_func.h" | ||||||||
|
|
||||||||
| #include <gen_cpp/Exprs_types.h> | ||||||||
| #include <glog/logging.h> | ||||||||
| #include <stddef.h> | ||||||||
|
|
||||||||
| #include <algorithm> | ||||||||
| #include <iostream> | ||||||||
| #include <memory> | ||||||||
|
|
||||||||
| #include "runtime/define_primitive_type.h" | ||||||||
| #include "runtime/types.h" | ||||||||
| #include "vec/core/block.h" | ||||||||
| #include "vec/core/field.h" | ||||||||
| #include "vec/core/types.h" | ||||||||
| #include "vec/data_types/data_type.h" | ||||||||
|
|
||||||||
| namespace doris { | ||||||||
| namespace vectorized { | ||||||||
|
Comment on lines
+35
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces]
Suggested change
be/src/vec/exprs/vinfo_func.cpp:37: - } // namespace vectorized
- } // namespace doris
+ } // namespace doris |
||||||||
| class VExprContext; | ||||||||
| } // namespace vectorized | ||||||||
| } // namespace doris | ||||||||
|
|
||||||||
| namespace doris::vectorized { | ||||||||
|
|
||||||||
| VInfoFunc::VInfoFunc(const TExprNode& node) : VExpr(node) { | ||||||||
| Field field; | ||||||||
| switch (_type.type) { | ||||||||
| case TYPE_BIGINT: { | ||||||||
| field = Int64(node.info_func.int_value); | ||||||||
| break; | ||||||||
| } | ||||||||
| case TYPE_STRING: | ||||||||
| case TYPE_CHAR: | ||||||||
| case TYPE_VARCHAR: { | ||||||||
| field = node.info_func.str_value; | ||||||||
| break; | ||||||||
| } | ||||||||
| default: { | ||||||||
| DCHECK(false) << "Invalid type: " << _type.type; | ||||||||
| break; | ||||||||
| } | ||||||||
| } | ||||||||
| this->_column_ptr = _data_type->create_column_const(1, field); | ||||||||
| } | ||||||||
|
|
||||||||
| Status VInfoFunc::execute(VExprContext* context, vectorized::Block* block, int* result_column_id) { | ||||||||
| // Info function should return least one row, e.g. select current_user(). | ||||||||
| size_t row_size = std::max(block->rows(), size_t(1)); | ||||||||
| *result_column_id = VExpr::insert_param(block, {_column_ptr, _data_type, _expr_name}, row_size); | ||||||||
| return Status::OK(); | ||||||||
| } | ||||||||
|
|
||||||||
| } // namespace doris::vectorized | ||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "common/object_pool.h" | ||
| #include "common/status.h" | ||
| #include "vec/data_types/data_type.h" | ||
| #include "vec/exprs/vexpr.h" | ||
|
|
||
| namespace doris { | ||
| class TExprNode; | ||
|
|
||
| namespace vectorized { | ||
| class Block; | ||
| class VExprContext; | ||
|
|
||
| class VInfoFunc : public VExpr { | ||
| ENABLE_FACTORY_CREATOR(VInfoFunc); | ||
|
|
||
| public: | ||
| VInfoFunc(const TExprNode& node); | ||
| ~VInfoFunc() override = default; | ||
|
|
||
| const std::string& expr_name() const override { return _expr_name; } | ||
| Status execute(VExprContext* context, Block* block, int* result_column_id) override; | ||
|
|
||
| private: | ||
| const std::string _expr_name = "vinfofunc expr"; | ||
| ColumnPtr _column_ptr; | ||
| }; | ||
| } // namespace vectorized | ||
|
|
||
| } // namespace doris |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: inclusion of deprecated C++ header 'stddef.h'; consider using 'cstddef' instead [modernize-deprecated-headers]