Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-18540

Unnecessary retract messages when setIdleStateRetentionTime before converting dynamic table to retract stream

Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Unnecessary retract messages when setIdleStateRetentionTime before converting dynamic table to retract stream。  

       

      final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
      env.setParallelism(1);
      
      EnvironmentSettings es = EnvironmentSettings.newInstance().inStreamingMode().build();
      StreamTableEnvironment fsTableEnv = StreamTableEnvironment.create(env,es);
      
      DataStream<Integer> ds = env.fromElements(5,4,3,2,1);
      
      // if do not setIdleStateRetentionTime, it will output only one message as expected like '(true,5)' 
      // if do setIdleStateRetentionTime, it will output unnecessary retract messages like '(false,5)/(true,5)'
      fsTableEnv.getConfig().setIdleStateRetentionTime(Time.hours(1000000),Time.hours(10000000));
      fsTableEnv.createTemporaryView("test",ds,"id");
      Table test = fsTableEnv.sqlQuery("select max(id) from test");
      fsTableEnv.toRetractStream(test,Row.class).printToErr();
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            sunwq WeiqiangSun

            Dates

              Created:
              Updated:

              Slack

                Issue deployment