slinkydeveloper commented on a change in pull request #18030:
URL: https://github.com/apache/flink/pull/18030#discussion_r763726470



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastRuleProvider.java
##########
@@ -213,4 +217,11 @@ private CastRuleProvider addRule(CastRule<?, ?> rule) {
                 .findFirst()
                 .orElse(null);
     }
+
+    private LogicalType unwrapDistinct(LogicalType logicalType) {
+        if (logicalType.is(LogicalTypeRoot.DISTINCT_TYPE)) {

Review comment:
       I think it's fine to don't deeply unwrap it, for example assume you 
wanna cast using `ARRAY<DISTINCT<INT>>` to `ARRAY<LONG>`. Because in 
`ArrayToArrayCastRule` the method `CastRuleProvider#exists` and 
`CastRuleProvider#resolve` are invoked for the array item type, the 
`DISTINCT<INT>` will be correctly unwrapped to `INT`. Let me add a test just to 
make sure this works 




-- 
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]


Reply via email to