You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by sunjincheng121 <gi...@git.apache.org> on 2017/09/24 00:11:12 UTC

[GitHub] flink pull request #4128: [FLINK-6893][table]Add BIN supported in SQL

Github user sunjincheng121 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4128#discussion_r140644236
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/sql/ScalarSqlFunctions.scala ---
    @@ -33,6 +33,14 @@ object ScalarSqlFunctions {
         OperandTypes.NILADIC,
         SqlFunctionCategory.NUMERIC)
     
    +  val BIN = new SqlFunction(
    +    "BIN",
    +    SqlKind.OTHER_FUNCTION,
    +    ReturnTypes.explicit(SqlTypeName.VARCHAR),
    +    null,
    +    OperandTypes.NUMERIC,
    --- End diff --
    
    Yes, In current code we only support BYTE,SHORT,INTEGER,LONG. If we try to using a FLOAT input we will got the EXCEPTION. 
    If understand you correctly you want define a new operand types checker, just like `tableAPI(ScalarSqlFunction)`, But I in SQL I'd better using CALCITE's default `OperandTypeChecker`. What do you think?


---