hanyuzheng7 commented on PR #22917:
URL: https://github.com/apache/flink/pull/22917#issuecomment-1614713400

   > the return type is not right. it should always return nullable.
   
   It seem the return in this class is always nullable. so why you change it?
   
   ```
   /** Specific {@link TypeStrategy} for {@link 
BuiltInFunctionDefinitions#ARRAY_MAX}. */
   @Internal
   public class ArrayElementOutputTypeStrategy implements TypeStrategy {
       @Override
       public Optional<DataType> inferType(CallContext callContext) {
           DataType inputDataType = callContext.getArgumentDataTypes().get(0);
           if (inputDataType.getLogicalType().getTypeRoot() != 
LogicalTypeRoot.ARRAY) {
               return Optional.empty();
           }
           final DataType elementDataType = ((CollectionDataType) 
inputDataType).getElementDataType();
           if (inputDataType.getLogicalType().isNullable()) {
               return Optional.of(elementDataType.nullable());
           } else {
               return Optional.of(elementDataType);
           }
       }
   }
   ```
   
   So can you tell which cases will have bug during use this TypeStrategy, I've 
been thinking about this for a long time.


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