wuchong commented on a change in pull request #9394: [FLINK-13547][table-planner-blink] Verify and correct string function's semantic for Blink planner URL: https://github.com/apache/flink/pull/9394#discussion_r312319794
########## File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java ########## @@ -502,69 +482,56 @@ public void lookupOperatorOverloads( SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA1 = new SqlFunction( "SHA1", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA224 = new SqlFunction( "SHA224", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA256 = new SqlFunction( "SHA256", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA384 = new SqlFunction( "SHA384", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA512 = new SqlFunction( "SHA512", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)), + OperandTypes.family(SqlTypeFamily.STRING), SqlFunctionCategory.STRING); public static final SqlFunction SHA2 = new SqlFunction( "SHA2", SqlKind.OTHER_FUNCTION, VARCHAR_2000_NULLABLE, null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.INTEGER), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING, SqlTypeFamily.INTEGER)), + OperandTypes.sequence("'(DATA, HASH_LENGTH)'", Review comment: ```suggestion OperandTypes.sequence("'SHA2(<STRING>, <HASH_LENGTH>)'", ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services