You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/04 10:20:35 UTC

[GitHub] [flink] twalthr commented on a diff in pull request #19087: [FLINK-26467][table-planner] Compile RowDataToStringConverter lazily

twalthr commented on code in PR #19087:
URL: https://github.com/apache/flink/pull/19087#discussion_r841582266


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/RowDataToStringConverterImpl.java:
##########
@@ -51,9 +53,18 @@ public RowDataToStringConverterImpl(DataType dataType) {
                 false);
     }
 
-    @SuppressWarnings("unchecked")
     public RowDataToStringConverterImpl(
             DataType dataType, ZoneId zoneId, ClassLoader classLoader, boolean legacyBehaviour) {
+        this.dataType = dataType;
+        this.castRuleContext = CastRule.Context.create(legacyBehaviour, zoneId, classLoader);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void init() {
+        if (this.columnConverters != null) {

Review Comment:
   if we move this condition into `convert`, we safe a virtual call in the hot path



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org