matriv commented on a change in pull request #18162:
URL: https://github.com/apache/flink/pull/18162#discussion_r774481392
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/BinaryToBinaryCastRule.java
##########
@@ -60,18 +62,35 @@ public String generateExpression(
int inputLength = LogicalTypeChecks.getLength(inputLogicalType);
int targetLength = LogicalTypeChecks.getLength(targetLogicalType);
- if (context.legacyBehaviour()) {
+ if (context.legacyBehaviour()
+ || ((!couldTrim(targetLength)
+ // Assume input length is respected by the
source
+ || (inputLength <= targetLength))
Review comment:
I cannot do that apart from the check for the `legacyBehaviour`, the
other condition cannot be splitted, it has to be evaluated as a whole.
--
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]