luoyuxia commented on code in PR #21663:
URL: https://github.com/apache/flink/pull/21663#discussion_r1098148881
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/type/NumericOrDefaultReturnTypeInference.java:
##########
@@ -56,11 +55,7 @@ public RelDataType inferReturnType(SqlOperatorBinding
opBinding) {
List<RelDataType> types = new ArrayList<>();
for (int i = startTypeIdx; i < nOperands; i++) {
RelDataType type = opBinding.getOperandType(i);
- if (SqlTypeUtil.isNumeric(type)) {
- types.add(type);
- } else {
- return opBinding.getOperandType(defaultTypeIdx);
- }
+ types.add(type);
Review Comment:
It's just my personal opinion, the reason behind that is the class
`NumericOrDefaultReturnTypeInference` is designed for
- if the operands are Numeric, consider each Numeric and find the
leastRestrictive
- Otherwise, it will return the sencond as the return type.
Above is what i infer from the class name and java doc
If we skip all checks, the usage of the class
`NumericOrDefaultReturnTypeInference` changes.
Then we'll need to modify the class name and java doc.
--
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]