flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suez1224 <...@git.apache.org>
Subject [GitHub] flink pull request #5619: [FLINK-8838] [table] Add Support for UNNEST a Mult...
Date Fri, 18 May 2018 01:44:54 GMT
Github user suez1224 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5619#discussion_r189144224
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/util/ExplodeFunctionUtil.scala
---
    @@ -18,74 +18,244 @@
     
     package org.apache.flink.table.plan.util
     
    +import java.util
    +
     import org.apache.flink.api.common.typeinfo.{BasicArrayTypeInfo, BasicTypeInfo, PrimitiveArrayTypeInfo,
TypeInformation}
    -import org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo
    +import org.apache.flink.api.java.typeutils.{MultisetTypeInfo, ObjectArrayTypeInfo}
     import org.apache.flink.table.functions.TableFunction
     
     class ObjectExplodeTableFunc extends TableFunction[Object] {
       def eval(arr: Array[Object]): Unit = {
    -    arr.foreach(collect)
    +    if (null != arr) {
    +      var i = 0
    --- End diff --
    
    Can't you just do the following?
    
    ` if (null != arr) {
         arr.foreach(collect)
    }`


---

Mime
View raw message