eldenmoon commented on code in PR #32225:
URL: https://github.com/apache/doris/pull/32225#discussion_r1524500698
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FunctionBinder.java:
##########
@@ -188,6 +191,15 @@ public Expression visitUnboundFunction(UnboundFunction
unboundFunction, Expressi
// so wrap COUNT with Nvl to ensure it's result is 0 instead
of null to get the correct result
boundFunction = new Nvl(boundFunction, new BigIntLiteral(0));
}
+ if (context.cascadesContext.currentElementAtLevel() == 1
Review Comment:
done
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java:
##########
@@ -492,17 +492,27 @@ private Type getCmpType() throws AnalysisException {
}
}
- if ((t1.isDecimalV3Type() && !t2.isStringType() &&
!t2.isFloatingPointType())
- || (t2.isDecimalV3Type() && !t1.isStringType() &&
!t1.isFloatingPointType())) {
+ if ((t1.isDecimalV3Type() && !t2.isStringType() &&
!t2.isFloatingPointType() && !t2.isVariantType())
+ || (t2.isDecimalV3Type() && !t1.isStringType() &&
!t1.isFloatingPointType() && !t1.isVariantType())) {
return Type.getAssignmentCompatibleType(getChild(0).getType(),
getChild(1).getType(), false,
SessionVariable.getEnableDecimal256());
}
// Variant can be implicit cast to numeric type and string type at
present
if (t1.isVariantType() && (t2.isNumericType() || t2.isStringType())) {
+ if (t2.isDecimalV2Type() || t2.isDecimalV3Type()) {
+ // TODO support decimal
+ throw new
org.apache.doris.nereids.exceptions.AnalysisException("Not support cast to
decimal type"
+ + " at present, maybe explicitly cast variant to
double");
+ }
return Type.fromPrimitiveType(t2);
}
if (t2.isVariantType() && (t1.isNumericType() || t1.isStringType())) {
+ if (t1.isDecimalV2Type() || t1.isDecimalV3Type()) {
+ // TODO support decimal
+ throw new
org.apache.doris.nereids.exceptions.AnalysisException("Not support cast to
decimal type"
+ + " at present, maybe explicitly cast variant to
double");
+ }
Review Comment:
done
--
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]