Search in sources :

Example 1 with WindowTableFunctionOperator

use of org.apache.flink.table.runtime.operators.window.WindowTableFunctionOperator in project flink by apache.

the class CommonExecWindowTableFunction method translateToPlanInternal.

@SuppressWarnings("unchecked")
@Override
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner, ExecNodeConfig config) {
    final ExecEdge inputEdge = getInputEdges().get(0);
    final Transformation<RowData> inputTransform = (Transformation<RowData>) inputEdge.translateToPlan(planner);
    WindowAssigner<TimeWindow> windowAssigner = createWindowAssigner(windowingStrategy);
    final ZoneId shiftTimeZone = TimeWindowUtil.getShiftTimeZone(windowingStrategy.getTimeAttributeType(), config.getLocalTimeZone());
    WindowTableFunctionOperator windowTableFunctionOperator = new WindowTableFunctionOperator(windowAssigner, windowingStrategy.getTimeAttributeIndex(), shiftTimeZone);
    return ExecNodeUtil.createOneInputTransformation(inputTransform, createTransformationMeta(WINDOW_TRANSFORMATION, config), windowTableFunctionOperator, InternalTypeInfo.of(getOutputType()), inputTransform.getParallelism());
}
Also used : RowData(org.apache.flink.table.data.RowData) Transformation(org.apache.flink.api.dag.Transformation) ExecEdge(org.apache.flink.table.planner.plan.nodes.exec.ExecEdge) ZoneId(java.time.ZoneId) WindowTableFunctionOperator(org.apache.flink.table.runtime.operators.window.WindowTableFunctionOperator) TimeWindow(org.apache.flink.table.runtime.operators.window.TimeWindow)

Aggregations

ZoneId (java.time.ZoneId)1 Transformation (org.apache.flink.api.dag.Transformation)1 RowData (org.apache.flink.table.data.RowData)1 ExecEdge (org.apache.flink.table.planner.plan.nodes.exec.ExecEdge)1 TimeWindow (org.apache.flink.table.runtime.operators.window.TimeWindow)1 WindowTableFunctionOperator (org.apache.flink.table.runtime.operators.window.WindowTableFunctionOperator)1