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

    https://github.com/apache/flink/pull/1775#discussion_r55924060
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/codegen/calls/ScalarFunctions.scala
 ---
    @@ -109,13 +110,83 @@ object ScalarFunctions {
         Seq(STRING_TYPE_INFO, STRING_TYPE_INFO),
         BuiltInMethod.SIMILAR.method)
     
    +  // arithmetic functions
    +
    +  addSqlFunctionMethod(
    +    LOG10,
    +    Seq(DOUBLE_TYPE_INFO),
    +    DOUBLE_TYPE_INFO,
    +    BuiltInMethods.LOG10)
    +
    +  addSqlFunctionMethod(
    +    LN,
    +    Seq(DOUBLE_TYPE_INFO),
    +    DOUBLE_TYPE_INFO,
    +    BuiltInMethods.LN)
    +
    +  addSqlFunctionMethod(
    +    EXP,
    +    Seq(DOUBLE_TYPE_INFO),
    +    DOUBLE_TYPE_INFO,
    +    BuiltInMethods.EXP)
    +
    +  addSqlFunctionMethod(
    +    POWER,
    +    Seq(DOUBLE_TYPE_INFO, DOUBLE_TYPE_INFO),
    +    DOUBLE_TYPE_INFO,
    +    BuiltInMethods.POWER)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(BYTE_TYPE_INFO),
    +    BYTE_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(SHORT_TYPE_INFO),
    +    SHORT_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(INT_TYPE_INFO),
    +    INT_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(LONG_TYPE_INFO),
    +    LONG_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(FLOAT_TYPE_INFO),
    +    FLOAT_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +  addSqlFunctionMethod(
    +    ABS,
    +    Seq(DOUBLE_TYPE_INFO),
    +    DOUBLE_TYPE_INFO,
    +    BuiltInMethods.ABS)
    +
    +
       // 
----------------------------------------------------------------------------------------------
     
       def getCallGenerator(
           call: SqlOperator,
           operandTypes: Seq[TypeInformation[_]])
         : Option[CallGenerator] = {
    +
         sqlFunctions.get((call, operandTypes))
    +      .orElse(sqlFunctions.find(entry => entry._1._1 == call
    +        && entry._1._2.zip(operandTypes).forall {
    --- End diff --
    
    I think it is better to check the operand lengths first, instead of 
ignoring additional operands of one side if the lengths differ.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to