matriv commented on a change in pull request #18063:
URL: https://github.com/apache/flink/pull/18063#discussion_r767549377
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/ArrayToStringCastRule.java
##########
@@ -91,74 +121,94 @@ protected String generateCodeBlockInternal(
context.declareClassField(
className(StringBuilder.class), builderTerm,
constructorCall(StringBuilder.class));
- return new CastRuleUtils.CodeWriter()
- .stmt(methodCall(builderTerm, "setLength", 0))
- .stmt(methodCall(builderTerm, "append", strLiteral("[")))
- .forStmt(
- methodCall(inputTerm, "size"),
- (indexTerm, loopBodyWriter) -> {
- String elementTerm = newName("element");
- String elementIsNullTerm =
newName("elementIsNull");
+ final String resultStringTerm = newName("resultString");
+ final int precision = LogicalTypeChecks.getLength(targetLogicalType);
Review comment:
For example we have a method `lengthExceedsPrecision`, if we rename that
var to `length` it will be confusing.
--
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]