JiajunBernoulli commented on a change in pull request #2615:
URL: https://github.com/apache/calcite/pull/2615#discussion_r757853246
##########
File path:
core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
##########
@@ -104,14 +104,17 @@ public TypeCoercionImpl(RelDataTypeFactory typeFactory,
SqlValidator validator)
updateInferredColumnType(scope1, query, columnIndex, targetType);
return true;
case VALUES:
+ boolean coercedValues = true;
for (SqlNode rowConstructor : ((SqlCall) query).getOperandList()) {
if (!coerceOperandType(scope, (SqlCall) rowConstructor, columnIndex,
targetType)) {
- return false;
+ coercedValues = false;
}
}
- updateInferredColumnType(
- requireNonNull(scope, "scope"), query, columnIndex, targetType);
- return true;
+ if (coercedValues) {
+ updateInferredColumnType(
+ requireNonNull(scope, "scope"), query, columnIndex, targetType);
Review comment:
I modified the expected values of failed unit tests. They should all be
not null. Are there any other questions?
--
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]