fsk119 commented on code in PR #23250: URL: https://github.com/apache/flink/pull/23250#discussion_r1303828192
########## flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/RowToRowCastRule.java: ########## @@ -221,7 +221,8 @@ protected String generateCodeBlockInternal( elseBodyWriter.stmt(writeNull)); } - writer.stmt(methodCall(writerTerm, "complete")).assignStmt(returnVariable, rowTerm); + writer.stmt(methodCall(writerTerm, "complete")) Review Comment: Please also fix the codes in the line 147 ########## flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/RowToRowCastRule.java: ########## @@ -221,7 +221,8 @@ protected String generateCodeBlockInternal( elseBodyWriter.stmt(writeNull)); } - writer.stmt(methodCall(writerTerm, "complete")).assignStmt(returnVariable, rowTerm); + writer.stmt(methodCall(writerTerm, "complete")) + .assignStmt(returnVariable, rowTerm + ".copy()"); Review Comment: BTW, the current design is not very good. It should let the outter to determine whether we should copy or not. For this case, it's better that ArrayToArrayCastRule to determine whether the inner block should reuse or not if the object is reused. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org