lincoln-lil commented on PR #23478:
URL: https://github.com/apache/flink/pull/23478#issuecomment-1763405879

   > @lincoln-lil Based on the approach you provided, I attempted to write some 
test cases. However, there are two types that are not covered:
   > 
   > 1. non comparable types: I don't know how to construct case for this one.
   > 2. multiset types: The framework throws an error when using a multiset.
   >    ```
   >    testSqlApi("f26 = MULTISET['b', 'a', 'b']", "TRUE")
   >    ```
   >    
   >    
   >        
   >          
   >        
   >    
   >          
   >        
   >    
   >        
   >      
   >    got exception:
   >    ```
   >    org.opentest4j.AssertionFailedError: Expression is converted into more 
than a Calc operation. Use a different test method. ==> expected: <true> but 
was: <false>
   >     at 
org.apache.flink.table.planner.expressions.utils.ExpressionTestBase.addTestExpr(ExpressionTestBase.scala:324)
   >    ```
   
   @fengjiajie for the non comparable types, I think we can ref to the 
`TypeCheckUtils#isComparable`:
   ```java
       public static boolean isComparable(LogicalType type) {
           return !isRaw(type)
                   && !isMap(type)
                   && !isMultiset(type)
                   && !isRow(type)
                   && !isArray(type)
                   && !isStructuredType(type);
       }
   ```
   
   for the multiset type, one viable way is using the `COLLECT`[1] aggregate 
function to construct it.
   
   1. 
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/systemfunctions/#aggregate-functions


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