flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clarkyzl <...@git.apache.org>
Subject [GitHub] flink pull request #3389: [FLINK-5881] [table] ScalarFunction(UDF) should su...
Date Wed, 01 Mar 2017 08:34:47 GMT
Github user clarkyzl commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3389#discussion_r103632469
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/utils/ScalarSqlFunction.scala
---
    @@ -112,9 +112,16 @@ object ScalarSqlFunction {
               .getParameterTypes(foundSignature)
               .map(typeFactory.createTypeFromTypeInfo)
     
    -        inferredTypes.zipWithIndex.foreach {
    -          case (inferredType, i) =>
    -            operandTypes(i) = inferredType
    +        operandTypes.zipWithIndex.foreach {
    +          case (_, i) =>
    +            if (i < inferredTypes.length - 1) {
    +              operandTypes(i) = inferredTypes(i)
    +            } else if (null != inferredTypes.last.getComponentType) {
    +              // last arguments is a collection, the array type
    +              operandTypes(i) = inferredTypes.last.getComponentType
    +            } else {
    +              operandTypes(i) = inferredTypes.last
    +            }
    --- End diff --
    
    The logic here has also been changed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message