lincoln-lil commented on a change in pull request #15117:
URL: https://github.com/apache/flink/pull/15117#discussion_r594206522



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/calcite/Expand.scala
##########
@@ -79,7 +83,27 @@ abstract class Expand(
     litmus.succeed()
   }
 
-  override def deriveRowType(): RelDataType = outputRowType
+  override def deriveRowType(): RelDataType = {
+    val fieldNullableMap = mutable.Map[Int, Boolean]()
+    projects.map {
+      project =>
+        project.zipWithIndex.map {
+          f => {
+            val nullable = 
fieldNullableMap.get(f._2).getOrElse(f._1.getType.isNullable)
+            fieldNullableMap.put(f._2, nullable || f._1.getType.isNullable)
+          }
+        }
+    }
+    val typeList = ListBuffer[RelDataType]()
+    val typeFactory = cluster.getTypeFactory
+    projects.get(0).zipWithIndex.map {

Review comment:
       good point!I'll try to investigate the two ways.




----------------------------------------------------------------
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:
[email protected]


Reply via email to