snuyanzin commented on code in PR #25752:
URL: https://github.com/apache/flink/pull/25752#discussion_r1881952675


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamLogicalOptimizeSelectDistinctRule.scala:
##########
@@ -0,0 +1,163 @@
+/*
+ * 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.physical.stream
+import org.apache.flink.table.planner.JList
+import org.apache.flink.table.planner.calcite.FlinkTypeFactory
+import 
org.apache.flink.table.planner.calcite.FlinkTypeFactory.{isRowtimeIndicatorType,
 isTimeIndicatorType}
+import org.apache.flink.table.planner.plan.metadata.FlinkRelMetadataQuery
+import org.apache.flink.table.planner.plan.nodes.FlinkConventions
+import 
org.apache.flink.table.planner.plan.nodes.logical.{FlinkLogicalAggregate, 
FlinkLogicalCalc, FlinkLogicalJoin, FlinkLogicalRank}
+import 
org.apache.flink.table.planner.plan.nodes.physical.stream.{StreamPhysicalIntervalJoin,
 StreamPhysicalRank, StreamPhysicalTemporalSort}
+import org.apache.flink.table.planner.plan.utils.{RankProcessStrategy, 
RankUtil, WindowJoinUtil}
+import 
org.apache.flink.table.planner.plan.utils.WindowUtil.groupingContainsWindowStartEnd
+import org.apache.flink.table.runtime.operators.rank.{ConstantRankRange, 
RankType}
+import org.apache.flink.table.types.logical.IntType
+
+import org.apache.calcite.plan.{RelOptRule, RelOptRuleCall}
+import org.apache.calcite.plan.RelOptRule.{any, operand}
+import org.apache.calcite.rel.`type`.{RelDataType, RelDataTypeField, 
RelDataTypeFieldImpl, RelDataTypeSystem}
+import org.apache.calcite.rel.{RelCollation, RelCollations, RelFieldCollation}
+import org.apache.calcite.rel.RelNode
+import org.apache.calcite.rel.convert.ConverterRule.Config
+import org.apache.calcite.rel.core.JoinRelType
+import org.apache.calcite.rel.hint.RelHint
+import org.apache.calcite.rel.logical.LogicalProject
+import org.apache.calcite.rex.{RexInputRef, RexNode, RexProgram}
+import org.apache.calcite.util.ImmutableBitSet
+
+import java.util
+import java.util.Collections
+
+import scala.collection.convert.ImplicitConversions.`iterable AsScalaIterable`
+
+/**
+ * Rule that matches [[FlinkLogicalAggregate]], and converts it to 
[[FlinkLogicalRank]] in the case
+ * of SELECT DISTINCT queries.
+ *
+ * e.g. {SELECT DISTINCT a, b, c;} will be converted to [[FlinkLogicalRank]] 
instead of
+ * [[FlinkLogicalAggregate]] in rowtime.
+ */
+class StreamLogicalOptimizeSelectDistinctRule

Review Comment:
   Ideally it would be great to have it converted to java in this PR.
   I looked into some previous PR and this is how it was: if a rule was new 
then it was requested to have it in java
   if it is an old one then it's ok to convert it in a separate PR



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to