-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-3.0: [enhance](orc) Optimize ORC Predicate Pushdown for OR-connected Predicate #43255 #44436
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,20 +17,9 @@ | |
|
|
||
| #include "testutil/desc_tbl_builder.h" | ||
|
Contributor
Author
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: 'testutil/desc_tbl_builder.h' file not found [clang-diagnostic-error] #include "testutil/desc_tbl_builder.h"
^ |
||
|
|
||
| #include <glog/logging.h> | ||
| #include <gtest/gtest-message.h> | ||
| #include <gtest/gtest-test-part.h> | ||
| #include <gtest/gtest.h> | ||
|
|
||
| #include <vector> | ||
|
|
||
| #include "common/object_pool.h" | ||
| #include "common/status.h" | ||
| #include "gtest/gtest_pred_impl.h" | ||
| #include "runtime/define_primitive_type.h" | ||
| #include "runtime/descriptors.h" | ||
| #include "util/bit_util.h" | ||
|
|
||
| using std::vector; | ||
|
|
||
| namespace doris { | ||
|
|
||
|
|
@@ -44,7 +33,7 @@ TupleDescBuilder& DescriptorTblBuilder::declare_tuple() { | |
|
|
||
| // item_id of -1 indicates no itemTupleId | ||
| static TSlotDescriptor make_slot_descriptor(int id, int parent_id, const TypeDescriptor& type, | ||
| int slot_idx, int item_id) { | ||
| const std::string& name, int slot_idx, int item_id) { | ||
| int null_byte = slot_idx / 8; | ||
| int null_bit = slot_idx % 8; | ||
| TSlotDescriptor slot_desc; | ||
|
|
@@ -58,6 +47,7 @@ static TSlotDescriptor make_slot_descriptor(int id, int parent_id, const TypeDes | |
| slot_desc.__set_nullIndicatorBit(null_bit); | ||
| slot_desc.__set_slotIdx(slot_idx); | ||
| slot_desc.__set_isMaterialized(true); | ||
| slot_desc.__set_colName(name); | ||
| // if (item_id != -1) { | ||
| // slot_desc.__set_itemTupleId(item_id); | ||
| // } | ||
|
|
@@ -78,24 +68,27 @@ DescriptorTbl* DescriptorTblBuilder::build() { | |
| int tuple_id = 0; | ||
| int slot_id = 0; | ||
|
|
||
| for (int i = 0; i < _tuples_descs.size(); ++i) { | ||
| build_tuple(_tuples_descs[i]->slot_types(), &thrift_desc_tbl, &tuple_id, &slot_id); | ||
| for (auto& _tuples_desc : _tuples_descs) { | ||
| build_tuple(_tuples_desc->slot_types(), _tuples_desc->slot_names(), &thrift_desc_tbl, | ||
| &tuple_id, &slot_id); | ||
| } | ||
|
|
||
| Status status = DescriptorTbl::create(_obj_pool, thrift_desc_tbl, &desc_tbl); | ||
| EXPECT_TRUE(status.ok()); | ||
| return desc_tbl; | ||
| } | ||
|
|
||
| TTupleDescriptor DescriptorTblBuilder::build_tuple(const vector<TypeDescriptor>& slot_types, | ||
| TTupleDescriptor DescriptorTblBuilder::build_tuple(const std::vector<TypeDescriptor>& slot_types, | ||
| const std::vector<std::string>& slot_names, | ||
| TDescriptorTable* thrift_desc_tbl, | ||
| int* next_tuple_id, int* slot_id) { | ||
| // We never materialize struct slots (there's no in-memory representation of structs, | ||
| // instead the materialized fields appear directly in the tuple), but array types can | ||
| // still have a struct item type. In this case, the array item tuple contains the | ||
| // "inlined" struct fields. | ||
| if (slot_types.size() == 1 && slot_types[0].type == TYPE_STRUCT) { | ||
| return build_tuple(slot_types[0].children, thrift_desc_tbl, next_tuple_id, slot_id); | ||
| return build_tuple(slot_types[0].children, slot_types[0].field_names, thrift_desc_tbl, | ||
| next_tuple_id, slot_id); | ||
| } | ||
|
|
||
| int tuple_id = *next_tuple_id; | ||
|
|
@@ -111,7 +104,7 @@ TTupleDescriptor DescriptorTblBuilder::build_tuple(const vector<TypeDescriptor>& | |
| // } | ||
|
|
||
| thrift_desc_tbl->slotDescriptors.push_back( | ||
| make_slot_descriptor(*slot_id, tuple_id, slot_types[i], i, item_id)); | ||
| make_slot_descriptor(*slot_id, tuple_id, slot_types[i], slot_names[i], i, item_id)); | ||
| thrift_desc_tbl->__isset.slotDescriptors = true; | ||
| ++(*slot_id); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,15 +20,16 @@ | |
|
|
||
| #include <gen_cpp/Descriptors_types.h> | ||
|
Contributor
Author
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: 'gen_cpp/Descriptors_types.h' file not found [clang-diagnostic-error] #include <gen_cpp/Descriptors_types.h>
^ |
||
|
|
||
| #include <tuple> | ||
| #include <vector> | ||
|
|
||
| #include "common/object_pool.h" | ||
| #include "runtime/descriptors.h" | ||
| #include "runtime/types.h" | ||
|
|
||
| namespace doris { | ||
|
|
||
| class ObjectPool; | ||
| class TupleDescBuilder; | ||
| class DescriptorTbl; | ||
|
|
||
| // Aids in the construction of a DescriptorTbl by declaring tuples and slots | ||
| // associated with those tuples. | ||
|
|
@@ -40,6 +41,7 @@ class DescriptorTbl; | |
| // DescriptorTblBuilder builder; | ||
| // builder.declare_tuple() << TYPE_TINYINT << TYPE_TIMESTAMP; // gets TupleId 0 | ||
| // builder.declare_tuple() << TYPE_FLOAT; // gets TupleId 1 | ||
| // builder.declare_tuple() << std::make_tuple(TYPE_INT, "col1") << std::make_tuple(TYPE_STRING, "col2"); // gets Tuple with type and name | ||
| // DescriptorTbl desc_tbl = builder.build(); | ||
| class DescriptorTblBuilder { | ||
| public: | ||
|
|
@@ -57,20 +59,31 @@ class DescriptorTblBuilder { | |
| std::vector<TupleDescBuilder*> _tuples_descs; | ||
|
|
||
| TTupleDescriptor build_tuple(const std::vector<TypeDescriptor>& slot_types, | ||
| const std::vector<std::string>& slot_names, | ||
| TDescriptorTable* thrift_desc_tbl, int* tuple_id, int* slot_id); | ||
| }; | ||
|
|
||
| class TupleDescBuilder { | ||
| public: | ||
| using SlotType = std::tuple<TypeDescriptor, std::string>; | ||
| TupleDescBuilder& operator<<(const SlotType& slot) { | ||
| _slot_types.push_back(std::get<0>(slot)); | ||
| _slot_names.push_back(std::get<1>(slot)); | ||
| return *this; | ||
| } | ||
|
|
||
| TupleDescBuilder& operator<<(const TypeDescriptor& slot_type) { | ||
| _slot_types.push_back(slot_type); | ||
| _slot_names.emplace_back(""); | ||
| return *this; | ||
| } | ||
|
|
||
| std::vector<TypeDescriptor> slot_types() const { return _slot_types; } | ||
| std::vector<std::string> slot_names() const { return _slot_names; } | ||
|
|
||
| private: | ||
| std::vector<TypeDescriptor> _slot_types; | ||
| std::vector<std::string> _slot_names; | ||
| }; | ||
|
|
||
| } // end namespace doris | ||
|
|
||
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: 'cctz/time_zone.h' file not found [clang-diagnostic-error]