-
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
[Enhancement] support user variable in analytic function #47728
Conversation
Signed-off-by: packy92 <wangchao@starrocks.com>
Signed-off-by: packy92 <wangchao@starrocks.com>
Signed-off-by: packy92 <wangchao@starrocks.com>
Signed-off-by: packy92 <wangchao@starrocks.com>
Signed-off-by: packy92 <wangchao@starrocks.com>
} | ||
|
||
return Optional.empty(); | ||
} | ||
} |
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 most risky bug in this code is:
Optional.get() without checking for presence
You can modify the code like this:
if (k.isPresent() && counterNum.isPresent() && k.get() > counterNum.get()) {
throw new SemanticException(
"The second parameter must be smaller than or equal to the third parameter" +
functionCallExpr.toSql(), kExpr.getPos());
}
fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AnalyticAnalyzer.java
Show resolved
Hide resolved
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
[FE Incremental Coverage Report]✅ pass : 37 / 37 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: packy92 <wangchao@starrocks.com> (cherry picked from commit 09d8d3a)
Signed-off-by: packy92 <wangchao@starrocks.com> (cherry picked from commit 09d8d3a) # Conflicts: # test/sql/test_hint/R/test_hint # test/sql/test_hint/T/test_hint
Why I'm doing:
What I'm doing:
consider user varibale in constant expr check.
Fixes #47225
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: