snuyanzin commented on code in PR #24140: URL: https://github.com/apache/flink/pull/24140#discussion_r1519024028
########## flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/WindowAggregateReduceFunctionsRule.java: ########## @@ -0,0 +1,90 @@ +/* + * 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.planner.plan.rules.logical; + +import org.apache.flink.table.planner.plan.nodes.calcite.LogicalWindowAggregate; + +import org.apache.calcite.plan.Contexts; +import org.apache.calcite.rel.core.Aggregate; +import org.apache.calcite.rel.core.AggregateCall; +import org.apache.calcite.rel.core.RelFactories; +import org.apache.calcite.rel.logical.LogicalAggregate; +import org.apache.calcite.rel.rules.AggregateReduceFunctionsRule; +import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rex.RexNode; +import org.apache.calcite.tools.RelBuilder; +import org.apache.calcite.tools.RelBuilderFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * Rule to convert complex aggregation functions into simpler ones. Have a look at + * [[AggregateReduceFunctionsRule]] for details. + */ +public class WindowAggregateReduceFunctionsRule extends AggregateReduceFunctionsRule { + private static final RelBuilderFactory LOGICAL_BUILDER_WITHOUT_AGG_INPUT_PRUNE = + RelBuilder.proto( + Contexts.of( + RelFactories.DEFAULT_STRUCT, + RelBuilder.Config.DEFAULT.withPruneInputOfAggregate(false))); + + public static final WindowAggregateReduceFunctionsRule Review Comment: No, unfortunately that's not possible or at least I don't know how to do it. The problem is that normally the rule should extend from `RelRule` where custom config class is a parameter. However here we extend from `AggregateReduceFunctionsRule` where the config is already defained inside `AggregateReduceFunctionsRule` and we can not change it since the class is inside Calcite -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
