Search in sources :

Example 21 with NamedWindowProperty

use of org.apache.flink.table.runtime.groupwindow.NamedWindowProperty in project flink by splunk.

the class StreamExecWindowAggregate method createAggsHandler.

private GeneratedNamespaceAggsHandleFunction<Long> createAggsHandler(SliceAssigner sliceAssigner, AggregateInfoList aggInfoList, ExecNodeConfig config, RelBuilder relBuilder, List<LogicalType> fieldTypes, ZoneId shiftTimeZone) {
    final AggsHandlerCodeGenerator generator = new AggsHandlerCodeGenerator(new CodeGeneratorContext(config.getTableConfig()), relBuilder, JavaScalaConversionUtil.toScala(fieldTypes), // copyInputField
    false).needAccumulate();
    if (sliceAssigner instanceof SliceSharedAssigner) {
        generator.needMerge(0, false, null);
    }
    final List<WindowProperty> windowProperties = Arrays.asList(Arrays.stream(namedWindowProperties).map(NamedWindowProperty::getProperty).toArray(WindowProperty[]::new));
    return generator.generateNamespaceAggsHandler("WindowAggsHandler", aggInfoList, JavaScalaConversionUtil.toScala(windowProperties), sliceAssigner, shiftTimeZone);
}
Also used : NamedWindowProperty(org.apache.flink.table.runtime.groupwindow.NamedWindowProperty) WindowProperty(org.apache.flink.table.runtime.groupwindow.WindowProperty) NamedWindowProperty(org.apache.flink.table.runtime.groupwindow.NamedWindowProperty) CodeGeneratorContext(org.apache.flink.table.planner.codegen.CodeGeneratorContext) AggsHandlerCodeGenerator(org.apache.flink.table.planner.codegen.agg.AggsHandlerCodeGenerator) SliceSharedAssigner(org.apache.flink.table.runtime.operators.window.slicing.SliceSharedAssigner)

Aggregations

NamedWindowProperty (org.apache.flink.table.runtime.groupwindow.NamedWindowProperty)21 TableException (org.apache.flink.table.api.TableException)9 CodeGeneratorContext (org.apache.flink.table.planner.codegen.CodeGeneratorContext)9 AggsHandlerCodeGenerator (org.apache.flink.table.planner.codegen.agg.AggsHandlerCodeGenerator)9 WindowProperty (org.apache.flink.table.runtime.groupwindow.WindowProperty)9 SlidingWindowAssigner (org.apache.flink.table.runtime.operators.window.assigners.SlidingWindowAssigner)9 RowType (org.apache.flink.table.types.logical.RowType)9 InvocationTargetException (java.lang.reflect.InvocationTargetException)6 OneInputStreamOperator (org.apache.flink.streaming.api.operators.OneInputStreamOperator)6 ValueLiteralExpression (org.apache.flink.table.expressions.ValueLiteralExpression)6 PythonAggregateFunctionInfo (org.apache.flink.table.functions.python.PythonAggregateFunctionInfo)6 SessionGroupWindow (org.apache.flink.table.planner.plan.logical.SessionGroupWindow)6 SlidingGroupWindow (org.apache.flink.table.planner.plan.logical.SlidingGroupWindow)6 TumblingGroupWindow (org.apache.flink.table.planner.plan.logical.TumblingGroupWindow)6 WindowEnd (org.apache.flink.table.runtime.groupwindow.WindowEnd)6 WindowStart (org.apache.flink.table.runtime.groupwindow.WindowStart)6 Method (java.lang.reflect.Method)3 ZoneId (java.time.ZoneId)3 Configuration (org.apache.flink.configuration.Configuration)3 TableConfig (org.apache.flink.table.api.TableConfig)3