raminqaf commented on code in PR #28758:
URL: https://github.com/apache/flink/pull/28758#discussion_r3643815494
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/VariantToStringCastRule.java:
##########
@@ -45,6 +51,6 @@ public String generateStringExpression(
String inputTerm,
LogicalType inputLogicalType,
LogicalType targetLogicalType) {
- return methodCall(inputTerm, "toString");
+ return staticCall(VariantCastUtils.class, "toStringValue", inputTerm);
Review Comment:
Reverted the change. Now we follow this rule:
- VARCHAR(n): OK if length ≤ n, else throw.
- CHAR(n): OK only if length == n, else throw.
So `CAST (PARSE_JSON('ab') AS VARCHAR(3)) -> returns ab`
--
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]