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

Jane Chan edited comment on FLINK-31424 at 3/15/23 12:38 PM:
-------------------------------------------------------------

Hi, [~jirawech.s], thanks for reporting this issue.

When multiple sinks are involved, the optimizer will try to break the DAG into 
rel blocks. According to the provided SQL, the optimized intermediate 
relNode(root)  is the `StreamPhysicalWindowJoin`. It is wrapped as the new 
table scan source by 
`StreamCommonSubGraphBasedOptimizer#createIntermediateRelTable`.

The NPE is thrown because the `FlinkRelMdWindowProperties` does not support 
`StreamPhysicalGlobalWindowAggregate`. (Here, the input of 
`StreamPhysicalExchange` is `StreamPhysicalGlobalWindowAggregate`).

 

I would like to fix it. cc [~lincoln.86xy]


was (Author: qingyue):
Hi, [~jirawech.s], thanks for reporting this issue.

When multiple sinks are involved, the optimizer will try to break the DAG into 
rel blocks. According to the provided SQL, the optimized intermediate 
relNode(root)  is the `StreamPhysicalWindowJoin`. It is wrapped as the new 
table scan source by 
`StreamCommonSubGraphBasedOptimizer#createIntermediateRelTable`.

The NPE is thrown because the `FlinkRelMdWindowProperties` does not support 
`StreamPhysicalGlobalWindowAggregate`. (Here, the input of 
`StreamPhysicalExChange` is `StreamPhysicalGlobalWindowAggregate`).

 

I would like to fix it. cc [~lincoln.86xy]

> NullPointer when using StatementSet for multiple sinks
> ------------------------------------------------------
>
>                 Key: FLINK-31424
>                 URL: https://issues.apache.org/jira/browse/FLINK-31424
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.16.1
>            Reporter: jirawech.s
>            Priority: Major
>         Attachments: HelloFlinkWindowJoin.java
>
>
> I got following error when i tried to execute multiple sinks using 
> StatementSet. I am not sure what it is and where to find possible solution.
> Error
> {code:java}
> // code placeholder
> Exception in thread "main" java.lang.NullPointerException
>     at 
> org.apache.flink.table.planner.plan.metadata.FlinkRelMdWindowProperties.getJoinWindowProperties(FlinkRelMdWindowProperties.scala:373)
>     at 
> org.apache.flink.table.planner.plan.metadata.FlinkRelMdWindowProperties.getWindowProperties(FlinkRelMdWindowProperties.scala:349)
>     at 
> GeneratedMetadataHandler_WindowProperties.getWindowProperties_$(Unknown 
> Source)
>     at GeneratedMetadataHandler_WindowProperties.getWindowProperties(Unknown 
> Source)
>     at 
> org.apache.flink.table.planner.plan.metadata.FlinkRelMetadataQuery.getRelWindowProperties(FlinkRelMetadataQuery.java:261)
>     at 
> org.apache.flink.table.planner.plan.optimize.StreamCommonSubGraphBasedOptimizer.createIntermediateRelTable(StreamCommonSubGraphBasedOptimizer.scala:287)
>     at 
> org.apache.flink.table.planner.plan.optimize.StreamCommonSubGraphBasedOptimizer.optimizeBlock(StreamCommonSubGraphBasedOptimizer.scala:138)
>     at 
> org.apache.flink.table.planner.plan.optimize.StreamCommonSubGraphBasedOptimizer.$anonfun$optimizeBlock$1(StreamCommonSubGraphBasedOptimizer.scala:111)
>     at 
> org.apache.flink.table.planner.plan.optimize.StreamCommonSubGraphBasedOptimizer.$anonfun$optimizeBlock$1$adapted(StreamCommonSubGraphBasedOptimizer.scala:109)
>     at 
> scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:58)
>     at 
> scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:51)
>     at 
> scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47){code}
> You can test the code, please see the attachment



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to