snuyanzin commented on code in PR #24443: URL: https://github.com/apache/flink/pull/24443#discussion_r1519010699
########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/aggfunctions/ModeAggFunctionTest.java: ########## @@ -0,0 +1,74 @@ +/* + * 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.functions.aggfunctions; + +import org.apache.flink.table.data.StringData; +import org.apache.flink.table.runtime.functions.aggregate.ModeAggFunction; +import org.apache.flink.table.types.logical.VarCharType; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; + +import static org.apache.flink.table.data.StringData.fromString; + +/** Test case for built-in MODE with retraction aggregate function. */ +final class ModeAggFunctionTest + extends AggFunctionTestBase<StringData, StringData, ModeAggFunction.ModeAcc<StringData>> { + + @Override + protected List<List<StringData>> getInputValueSets() { + return Arrays.asList( + Arrays.asList(fromString("1"), fromString("1"), fromString("3")), + Arrays.asList(fromString("4"), null, fromString("4")), + Arrays.asList(null, null), + Arrays.asList( Review Comment: it seems there was an issue in test (merge/retract) which requires at least 2 input elements otherwise fail with exception. I added a hotfix to skipthis test for inputs with amount of elements less than 2 in a similar way it is done for cases without `merge`, `retract` implementation After that I added this test (merge is skipped however others are passed) -- 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