-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Feature] support in predict for complex types #26333
Conversation
_const_input.resize(_children.size()); | ||
for (auto i = 0; i < _children.size(); ++i) { | ||
if (dynamic_cast<VectorizedLiteral*>(_children[i])) { | ||
ASSIGN_OR_RETURN(_const_input[i], _children[i]->evaluate_checked(context, nullptr)); |
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.
except for the first one, other children must be constant, I think you can add DCHECK on expr.is_const
, and don't need complex handle
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.
seems Expr::is_constant()
is not overrided by some expression, and this interface is not really used.
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.
as currently rewritting non-const parameters of in predict to OR expressions results in slower performance, we could optimize it by allow in predict to support non-const parameteres, so it is necessary to keep this generial process.
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.
seems
Expr::is_constant()
is not overrided by some expression, and this interface is not really used.
- only a few functions doesn't support
is_constant
, such asrandom
, and we don't supportIN
on these function, don't worry. - as you say, I think reuse contant expression on
IN
predicate is unnecessary, but it's only need to modify FE. you can think about it, execut a constant expression once more is faster than execute it as a variable column in your template
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.
BTW, support variable column on IN
is not necessarily faster than using OR, it's comparison of row mode and column mode
Head branch was pushed to by a user without write access
dbf889b
to
3e9491f
Compare
int val_res = _values->equals(i, *(rhs_map._values.get()), j, safe_eq); | ||
|
||
// case 1: key_res == EQUALS_TRUE | ||
if (key_res == EQUALS_TRUE) { |
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 if (key_res == EQUALS_TRUE) {
is non-sense.
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 true, it has to diff from the case where key_res == EQUAL_NULL
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Signed-off-by: Zhuhe Fang <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
[FE PR Coverage Check]😞 fail : 9 / 13 (69.23%) file detail
|
@mergify backport branch-3.1 |
✅ Backports have been created
|
1. array/map/struct support in (value..) and in (subquery), json just support in (value...) 2. fix map equal bugs 3. fix stuct type's getCompatibleTypes error 4. support not equal for array/map/struct 5. fix cast struct bug of lacking nullable --------- Signed-off-by: Zhuhe Fang <[email protected]> (cherry picked from commit b4a6671)
1. array/map/struct support in (value..) and in (subquery), json just support in (value...) 2. fix map equal bugs 3. fix stuct type's getCompatibleTypes error 4. support not equal for array/map/struct 5. fix cast struct bug of lacking nullable --------- Signed-off-by: Zhuhe Fang <[email protected]> (cherry picked from commit b4a6671)
What type of PR is this:
Checklist:
Bugfix cherry-pick branch check: