Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[enhance](orc) Optimize ORC Predicate Pushdown for OR-connected Predicate#43255
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
55536084e405259e502967aea987b1920a846ca9ea1d4c71290066e12fb3227b113a681580092146d957ae06d561370bc8ec4cb76de033342d6aa72c7c96525bcd2c28906271dcdcbd2785fc5dccfe50d03604c95bfe51e1e9269bd9526c24a7f77bcdfd4bcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,20 +17,9 @@ | ||
| #include "testutil/desc_tbl_builder.h" | ||
suxiaogang223 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #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> | ||
suxiaogang223 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #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 | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.