[ https://issues.apache.org/jira/browse/FLINK-12116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xingcan Cui updated FLINK-12116: -------------------------------- Description: In tableAPI, the automatic typecast for arguments may break their initial structures, which makes {{TreeNode.makeCopy()}} fail. Take the {{ConcatWs}} function as an example. It requires a string {{Expression}} sequence for the second parameter of its constructor. If we provide some {{Expressions}} with other types, the planner will try to cast them automatically. However, during this process, the arguments will be incorrectly unwrapped (e.g., {{[f1, f2]}} will be unwrapped to two expressions {{f1.cast(String)}} and {{f2.cast(String)}}) which will cause {{java.lang.IllegalArgumentException: wrong number of arguments}} for {{Constructor.newInstance()}}. As a workaround, we can cast these arguments manually. was: In tableAPI, the automatic typecast for arguments may break their initial structures, which makes {{TreeNode.makeCopy()}} fail. Take the {{ConcatWs}} function as an example. It requires a string {{Expression}} sequence for the second parameter of its constructor. If we provide some {{Expressions}} with other types, the planner will try to cast them automatically. However, during this process, the arguments will be incorrectly unwrapped (e.g., {{[f1, f2]}} will be unwrapped to two expressions {{f1.cast(String)}} and {{f2.cast(String)}}) which will cause {{java.lang.IllegalArgumentException: wrong number of arguments}}. As a workaround, we can cast these arguments manually. > Args autocast will cause exception for plan transformation in TableAPI > ---------------------------------------------------------------------- > > Key: FLINK-12116 > URL: https://issues.apache.org/jira/browse/FLINK-12116 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.6.4, 1.7.2 > Reporter: Xingcan Cui > Priority: Major > > In tableAPI, the automatic typecast for arguments may break their initial > structures, which makes {{TreeNode.makeCopy()}} fail. > Take the {{ConcatWs}} function as an example. It requires a string > {{Expression}} sequence for the second parameter of its constructor. If we > provide some {{Expressions}} with other types, the planner will try to cast > them automatically. However, during this process, the arguments will be > incorrectly unwrapped (e.g., {{[f1, f2]}} will be unwrapped to two > expressions {{f1.cast(String)}} and {{f2.cast(String)}}) which will cause > {{java.lang.IllegalArgumentException: wrong number of arguments}} for > {{Constructor.newInstance()}}. > As a workaround, we can cast these arguments manually. -- This message was sent by Atlassian JIRA (v7.6.3#76005)