Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.11.3
Description
The following test case will encounter NPE:
val t = tEnv.fromValues( DataTypes.ROW( DataTypes.FIELD("a", DataTypes.INT()), DataTypes.FIELD("b", DataTypes.ARRAY(DataTypes.STRING())) ), row(1, Array("aa", "bb", "cc")), row(2, null), row(3, Array("dd")) ) tEnv.registerTable("T", t) tEnv.executeSql("SELECT a, s FROM T, UNNEST(T.b) as A (s)").print()
Exception is
Caused by: java.lang.NullPointerException
at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:192)
at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:192)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:32)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at org.apache.flink.table.planner.plan.utils.ObjectExplodeTableFunc.eval(ExplodeFunctionUtil.scala:34)
The reason is functions in ExplodeFunctionUtil do not handle null data. Since 1.12, the bug is fixed, see https://issues.apache.org/jira/browse/FLINK-18528
Attachments
Issue Links
- links to