zclllyybb commented on code in PR #61352:
URL: https://github.com/apache/doris/pull/61352#discussion_r3013271013


##########
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:
   if you mean support string types are suppose to be casted to bool input 
type, why we need `checkLegalityBeforeTypeCoercion`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to