[ 
https://issues.apache.org/jira/browse/FLINK-8838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479999#comment-16479999
 ] 

ASF GitHub Bot commented on FLINK-8838:
---------------------------------------

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

    https://github.com/apache/flink/pull/5619#discussion_r189144263
  
    --- 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
    +      while (i < arr.length) {
    +        collect(arr(i))
    +        i += 1
    +      }
    +    }
    +  }
    +
    +  def eval(map: util.Map[Object, Integer]): Unit = {
    +    if (null != map) {
    +      val it = map.entrySet().iterator()
    +      while(it.hasNext) {
    +        val item = it.next()
    +        var i = 0
    +        while (i < item.getValue) {
    +          collect(item.getKey)
    +          i += 1
    +        }
    +      }
    +    }
       }
     }
     
     class FloatExplodeTableFunc extends TableFunction[Float] {
       def eval(arr: Array[Float]): Unit = {
    -    arr.foreach(collect)
    +    if (null != arr) {
    --- End diff --
    
    same above and for the rest.


> Add Support for UNNEST a MultiSet type field
> --------------------------------------------
>
>                 Key: FLINK-8838
>                 URL: https://issues.apache.org/jira/browse/FLINK-8838
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API &amp; SQL
>            Reporter: lincoln.lee
>            Assignee: lincoln.lee
>            Priority: Major
>
> MultiSetTypeInfo was introduced by  FLINK-7491, and UNNEST support Array type 
> only,  so it would be nice to support UNNEST a MultiSet type field.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to