dssysolyatin commented on code in PR #4067:
URL: https://github.com/apache/calcite/pull/4067#discussion_r1861220581


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -2284,7 +2284,7 @@ private static RelDataType 
deriveTypeMapFromEntries(SqlOperatorBinding opBinding
   @LibraryOperator(libraries = {BIG_QUERY, ORACLE, POSTGRESQL})
   public static final SqlFunction CHR =
       SqlBasicFunction.create("CHR",
-          ReturnTypes.CHAR,
+          ReturnTypes.CHAR.andThen(SqlTypeTransforms.TO_NULLABLE),

Review Comment:
   It would be good to extract 
`ReturnTypes.CHAR.andThen(SqlTypeTransforms.TO_NULLABLE)` to `ReturnTypes` how 
it was done for other return-type inference strategies.
   
   Example:
   ```
   /**
      * Type-inference strategy whereby the result type of a call is Boolean,
      * with nulls allowed if any of the operands allow nulls.
      */
     public static final SqlReturnTypeInference BOOLEAN_NULLABLE =
         BOOLEAN.andThen(SqlTypeTransforms.TO_NULLABLE);
     ```    
   



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