-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat(tianmu): Support for user defined function(#538) #898
Conversation
This pull request's title should follow requirements next. @adofsauron please check it 👇. Valid format:
Valid types:
|
Thanks for the contribution! Please review the labels and make any necessary changes. |
@@ -0,0 +1,257 @@ | |||
--source include/have_tianmu.inc | |||
|
|||
--echo # |
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.
not necessary. you mtr's title has told that.
List_iterator_fast<Item> li(*fields); | ||
for (Item *item = li++; item; item = li++) { | ||
if ((item->type() == Item::Type::FUNC_ITEM) && | ||
(down_cast<Item_func *>(item)->functype() == Item_func::Functype::FUNC_SP) && (!sl->is_distinct())) { |
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.
The logic of this part is not ok. How about the field without disctinct ?
The from the if
statement, we can not read that fields has not distinct
keyword. Therefore, we can not add this option manually. And this option should be added in grammatical procesing stage.
select distinct xxxx
or
select xxxx
storage/tianmu/core/joiner.cpp
Outdated
@@ -41,6 +41,19 @@ TwoDimensionalJoiner::~TwoDimensionalJoiner() { | |||
|
|||
JoinAlgType TwoDimensionalJoiner::ChooseJoinAlgorithm([[maybe_unused]] MultiIndex &mind, Condition &cond) { | |||
auto choose_map_or_hash = ([&tianmu_sysvar_force_hashjoin, &cond] { | |||
{ | |||
std::vector<CQTerm *> terms = {&cond[0].attr, &cond[0].val1, &cond[0].val2}; | |||
for (auto term : terms) { |
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.
refine these lines.
for_each (terms.begin(), terms.end() [&](CQTerm *& tm) {
if (!tm || !tm->vc) return;
Item *item = term->vc->GetItem();
if (item && (item->type() == Item::Type::FUNC_ITEM) &&
(down_cast<Item_func *>(item)->functype() == Item_func::Functype::FUNC_SP)) {
join_type = JoinAlgType::JTYPE_GENERAL;
});
…0221107 into stonedb-5.7-dev
|
Summary about this PR
Issue Number: close #538
Tests Check List
Changelog
Documentation