You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/04/25 01:56:53 UTC

[GitHub] [flink] KurtYoung commented on a change in pull request #8179: [FLINK-12200] [Table-planner] Support UNNEST for MAP types

KurtYoung commented on a change in pull request #8179: [FLINK-12200] [Table-planner] Support UNNEST for MAP types
URL: https://github.com/apache/flink/pull/8179#discussion_r278374663
 
 

 ##########
 File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/rules/logical/LogicalUnnestRule.scala
 ##########
 @@ -94,6 +95,17 @@ class LogicalUnnestRule(
             case arrayType: ArrayRelDataType =>
               (arrayType.getComponentType,
                 ExplodeFunctionUtil.explodeTableFuncFromType(arrayType.typeInfo))
+
+            case map: MapRelDataType =>
+              val keyTypeInfo = FlinkTypeFactory.toTypeInfo(map.keyType)
+              val valueTypeInfo = FlinkTypeFactory.toTypeInfo(map.valueType)
+              val componentTypeInfo = createTuple2TypeInformation(keyTypeInfo,valueTypeInfo)
 
 Review comment:
   I checked other system's behavior, it seems more common to unnest map field into two columns, in your case, it would be:
   
   `SELECT k, v FROM t1 , UNNEST(t1.c) as (k,v)`
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services