wangxlong commented on a change in pull request #11058:
[FLINK-15995][Table-planner-blink] Change TO_BASE64 sql operator defination
URL: https://github.com/apache/flink/pull/11058#discussion_r377610046
##########
File path:
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -574,9 +574,9 @@ public SqlMonotonicity getMonotonicity(SqlOperatorBinding
call) {
public static final SqlFunction TO_BASE64 = new SqlFunction(
"TO_BASE64",
SqlKind.OTHER_FUNCTION,
- VARCHAR_2000_NULLABLE,
+ ReturnTypes.cascade(ReturnTypes.explicit(SqlTypeName.VARCHAR),
SqlTypeTransforms.TO_NULLABLE),
null,
- OperandTypes.ANY,
+ OperandTypes.family(SqlTypeFamily.STRING),
Review comment:
Thank you @wuchong @libenchao. We change from OperandTypes.ANY to
OperandTypes.family(SqlTypeFamily.STRING). If user apply int type to to_base
function. For the before, it will throw runtimeException. And for now, it will
fail in validation.
So, if we should add a test, I think we can add it to
org.apache.flink.table.planner.expressions.ScalarFunctionsTest to verify fail
in validation stage. For the org.apache.flink.table.expressions#testToBase64,
it already has test to verify the correct arguments.
It is right?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services