JiajunBernoulli commented on code in PR #2847:
URL: https://github.com/apache/calcite/pull/2847#discussion_r1041636188
##########
core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java:
##########
@@ -104,14 +104,15 @@ public TypeCoercionImpl(RelDataTypeFactory typeFactory,
SqlValidator validator)
updateInferredColumnType(scope1, query, columnIndex, targetType);
return true;
case VALUES:
+ boolean coerceValues = true;
for (SqlNode rowConstructor : ((SqlCall) query).getOperandList()) {
if (!coerceOperandType(scope, (SqlCall) rowConstructor, columnIndex,
targetType)) {
- return false;
+ coerceValues = false;
}
}
updateInferredColumnType(
requireNonNull(scope, "scope"), query, columnIndex, targetType);
- return true;
+ return coerceValues;
Review Comment:
Good advice, I refactor the rowTypeCoercion function.
Thanks for your review very much!
--
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]