[ https://issues.apache.org/jira/browse/FLINK-6969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062986#comment-16062986 ]
ASF GitHub Bot commented on FLINK-6969: --------------------------------------- Github user wuchong commented on a diff in the pull request: https://github.com/apache/flink/pull/4183#discussion_r123989779 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/triggers/DeferredComputationTrigger.scala --- @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.flink.table.runtime.triggers + +import org.apache.flink.streaming.api.windowing.triggers.{Trigger, TriggerResult} +import org.apache.flink.streaming.api.windowing.triggers.Trigger.{OnMergeContext, TriggerContext} +import org.apache.flink.streaming.api.windowing.windows.TimeWindow +import org.apache.flink.table.api.StreamQueryConfig + +/** + * A [[Trigger]] that onElement method never fires the window, and only fires when current + * watermark not smaller than (window.maxTimestamp + queryConfig.getDeferredComputationTime) + */ +class DeferredComputationTrigger(queryConfig: StreamQueryConfig) extends Trigger[Any, TimeWindow] { --- End diff -- I think the parameter can be only a `deferredComputationTime : Long`. It shouldn't be associated to StreamQueryConfig. > Add support for deferred computation for group window aggregates > ---------------------------------------------------------------- > > Key: FLINK-6969 > URL: https://issues.apache.org/jira/browse/FLINK-6969 > Project: Flink > Issue Type: New Feature > Components: Table API & SQL > Reporter: Fabian Hueske > Assignee: sunjincheng > > Deferred computation is a strategy to deal with late arriving data and avoid > updates of previous results. Instead of computing a result as soon as it is > possible (i.e., when a corresponding watermark was received), deferred > computation adds a configurable amount of slack time in which late data is > accepted before the result is compute. For example, instead of computing a > tumbling window of 1 hour at each full hour, we can add a deferred > computation interval of 15 minute to compute the result quarter past each > full hour. > This approach adds latency but can reduce the number of update esp. in use > cases where the user cannot influence the generation of watermarks. It is > also useful if the data is emitted to a system that cannot update result > (files or Kafka). The deferred computation interval should be configured via > the {{QueryConfig}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)