sunjincheng121 commented on a change in pull request #7167: [FLINK-10973] 
[table] Add support for map to table API
URL: https://github.com/apache/flink/pull/7167#discussion_r272048201
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/OperationTreeBuilder.scala
 ##########
 @@ -369,6 +369,14 @@ class OperationTreeBuilder(private val tableEnv: 
TableEnvironment) {
     Union(left.asInstanceOf[LogicalNode], right.asInstanceOf[LogicalNode], 
all).validate(tableEnv)
   }
 
+  def map(mapFunction: Expression, child: TableOperation): TableOperation = {
+    val childNode = child.asInstanceOf[LogicalNode]
+    val expandedFields = expandProjectList(
+      Seq(mapFunction).map(expressionBridge.bridge)
+        .map(Flattening), childNode, tableEnv)
 
 Review comment:
   `.map(expressionBridge.bridge) .map(Flattening)` 
   to
    `.map(e => Flattening(expressionBridge.bridge(e)))`
   I am not pretty which one is better? just a suggestion. :)
   What do you think?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to