-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 Mysql Field function #55331
Conversation
90206a8
to
9ed76ac
Compare
@@ -806,6 +807,45 @@ private static Function getAdjustedAnalyzedFunction(ConnectContext session, | |||
break; | |||
} | |||
} | |||
} else if (FunctionSet.FIELD.equalsIgnoreCase(fnName)) { |
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.
I think don't need this change, could be ref greatest
function
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 goal here is to make the FIELD function compatible with MySQL’s parameter type inference behavior. The default choice of function signature would otherwise lead to inconsistent behavior.
9ed76ac
to
4656202
Compare
(targetType.isStringType() && argumentTypes[i].isStringType())) { | ||
targetType = Type.getAssignmentCompatibleType(targetType, argumentTypes[i], false); | ||
if (targetType.isInvalid()) { | ||
throw new SemanticException("Parameter's type is not invalid"); |
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.
is not invalid
or is invalid
?
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.
Revised as is invalid
be/src/exprs/string_functions.h
Outdated
result.append(0); | ||
return result.build(true); | ||
} else if (state != nullptr) { | ||
LOG(WARNING) << "state:" << state->all_const << " " << state->list_all_const << std::endl; |
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.
Remove the log?
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.
done
91da794
to
7ad7705
Compare
66d5dcc
3416d97
to
98d2fc0
Compare
Signed-off-by: SevenJ <[email protected]>
98d2fc0
to
0c54136
Compare
Signed-off-by: SevenJ <[email protected]>
508aab5
to
0648036
Compare
Signed-off-by: SevenJ <[email protected]>
0648036
to
fae4205
Compare
|
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 34 / 35 (97.14%) file detail
|
[BE Incremental Coverage Report]❌ fail : 0 / 63 (00.00%) file detail
|
Why I'm doing:
For custom sorting.
What I'm doing:
Implement field function. Fixes #55585
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: