You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "JoverZhang (via GitHub)" <gi...@apache.org> on 2026/04/01 13:47:42 UTC
Re: [PR] [Enhancement](doris-future) Support REGR_ARGX, REGR_ARGY, REGR_COUNT and REGR_R2 aggregate functions [doris]
JoverZhang commented on code in PR #61352:
URL: https://github.com/apache/doris/pull/61352#discussion_r3022223866
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/RegrIntercept.java:
##########
@@ -65,12 +65,12 @@ private RegrIntercept(AggregateFunctionParams functionParams) {
public void checkLegalityBeforeTypeCoercion() throws AnalysisException {
DataType arg0Type = left().getDataType();
DataType arg1Type = right().getDataType();
- if ((!arg0Type.isNumericType() && !arg0Type.isNullType())
- || arg0Type.isOnlyMetricType()) {
- throw new AnalysisException("regr_intercept requires numeric for first parameter: " + toSql());
- } else if ((!arg1Type.isNumericType() && !arg1Type.isNullType())
- || arg1Type.isOnlyMetricType()) {
- throw new AnalysisException("regr_intercept requires numeric for second parameter: " + toSql());
+ if (!arg0Type.isNumericType() && !arg0Type.isBooleanType()
+ && !arg0Type.isNullType() && !arg0Type.isStringLikeType()) {
+ throw new AnalysisException("regr_intercept(y, x): y must be numeric, boolean or string type: " + toSql());
Review Comment:
Thanks, makes sense. I removed the check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org