Copilot commented on code in PR #16497: URL: https://github.com/apache/pinot/pull/16497#discussion_r2252253566
########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); Review Comment: This should be `AggregationFunctionType.MAXSTRING` instead of `AggregationFunctionType.MINSTRING` since this is testing the MaxString function. ```suggestion MaxStringAggregationFunction function = new MaxStringAggregationFunction(Collections.singletonList(expression), false); // Test function type assertEquals(function.getType(), AggregationFunctionType.MAXSTRING); // Test string comparisons assertEquals(function.merge("apple", "banana"), "banana"); assertEquals(function.merge("banana", "apple"), "banana"); assertEquals(function.merge("", "apple"), "apple"); assertEquals(function.merge("apple", ""), "apple"); ``` ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); Review Comment: For MAXSTRING, the merge of "apple" and "banana" should return "banana" (lexicographically larger), not "apple". ```suggestion MaxStringAggregationFunction function = new MaxStringAggregationFunction(Collections.singletonList(expression), false); // Test function type assertEquals(function.getType(), AggregationFunctionType.MAXSTRING); // Test string comparisons assertEquals(function.merge("apple", "banana"), "banana"); assertEquals(function.merge("banana", "apple"), "banana"); assertEquals(function.merge("", "apple"), "apple"); assertEquals(function.merge("apple", ""), "apple"); ``` ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); Review Comment: This should be `MaxStringAggregationFunction` instead of `MinStringAggregationFunction` since this is the MaxStringAggregationFunctionTest. ```suggestion MaxStringAggregationFunction function = new MaxStringAggregationFunction(Collections.singletonList(expression), false); // Test function type assertEquals(function.getType(), AggregationFunctionType.MAXSTRING); // Test string comparisons assertEquals(function.merge("apple", "banana"), "banana"); assertEquals(function.merge("banana", "apple"), "banana"); assertEquals(function.merge("", "apple"), "apple"); assertEquals(function.merge("apple", ""), "apple"); ``` ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); + + // Test null handling + assertEquals(function.merge("apple", null), "apple"); + assertEquals(function.merge(null, "apple"), "apple"); + assertNull(function.merge(null, null)); + + // Test final result merging + assertEquals(function.mergeFinalResult("apple", "banana"), "apple"); Review Comment: For MAXSTRING, the final result merge of "apple" and "banana" should return "banana" (lexicographically larger), not "apple". ```suggestion assertEquals(function.mergeFinalResult("apple", "banana"), "banana"); ``` ########## pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/MinStringAggregationFunction.java: ########## @@ -0,0 +1,172 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.List; +import java.util.Map; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.utils.DataSchema.ColumnDataType; +import org.apache.pinot.core.common.BlockValSet; +import org.apache.pinot.core.query.aggregation.AggregationResultHolder; +import org.apache.pinot.core.query.aggregation.ObjectAggregationResultHolder; +import org.apache.pinot.core.query.aggregation.groupby.GroupByResultHolder; +import org.apache.pinot.core.query.aggregation.groupby.ObjectGroupByResultHolder; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.exception.BadQueryRequestException; + +public class MinStringAggregationFunction extends NullableSingleInputAggregationFunction<String, String> { + + public MinStringAggregationFunction(List<ExpressionContext> arguments, boolean nullHandlingEnabled) { + super(verifySingleArgument(arguments, "MINSTRING"), nullHandlingEnabled); + } + + @Override + public AggregationFunctionType getType() { + return AggregationFunctionType.MINSTRING; + } + + @Override + public AggregationResultHolder createAggregationResultHolder() { + return new ObjectAggregationResultHolder(); + } + + @Override + public GroupByResultHolder createGroupByResultHolder(int initialCapacity, int maxCapacity) { + return new ObjectGroupByResultHolder(initialCapacity, maxCapacity); + } + + @Override + public void aggregate(int length, AggregationResultHolder aggregationResultHolder, + Map<ExpressionContext, BlockValSet> blockValSetMap) { + BlockValSet blockValSet = blockValSetMap.get(_expression); + if (blockValSet.getValueType().isNumeric()) { + throw new BadQueryRequestException("Cannot compute MINSTRING for numeric column: " + + blockValSet.getValueType()); + } + String[] stringValues = blockValSet.getStringValuesSV(); + forEachNotNull(length, blockValSet, (from, to) -> { + for (int i = from; i < to; i++) { + String value = stringValues[i]; + // Ignore null and "null" string literals + if (value == null || "null".equals(value)) { + continue; + } + String currentMin = aggregationResultHolder.getResult(); + // Update the currentMax if a larger string value is found Review Comment: The comment mentions "currentMax" but this is MinString function, so it should say "currentMin" and "smaller string value is found". ```suggestion // Update the currentMin if a smaller string value is found ``` ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); Review Comment: For MAXSTRING, the merge of "banana" and "apple" should return "banana" (lexicographically larger), not "apple". ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); Review Comment: For MAXSTRING, the merge of empty string and "apple" should return "apple" (lexicographically larger), not empty string. ```suggestion MaxStringAggregationFunction function = new MaxStringAggregationFunction(Collections.singletonList(expression), false); // Test function type assertEquals(function.getType(), AggregationFunctionType.MAXSTRING); // Test string comparisons assertEquals(function.merge("apple", "banana"), "banana"); assertEquals(function.merge("banana", "apple"), "banana"); assertEquals(function.merge("", "apple"), "apple"); assertEquals(function.merge("apple", ""), "apple"); ``` ########## pinot-core/src/test/java/org/apache/pinot/core/query/aggregation/function/MaxStringAggregationFunctionTest.java: ########## @@ -0,0 +1,238 @@ +/** + * 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.pinot.core.query.aggregation.function; + +import java.util.Collections; +import org.apache.pinot.common.request.context.ExpressionContext; +import org.apache.pinot.common.request.context.RequestContextUtils; +import org.apache.pinot.queries.FluentQueryTest; +import org.apache.pinot.segment.spi.AggregationFunctionType; +import org.apache.pinot.spi.data.FieldSpec; +import org.apache.pinot.spi.data.Schema; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + + +public class MaxStringAggregationFunctionTest extends AbstractAggregationFunctionTest { + + /** + * Helper method to create a FluentQueryTest builder for a table with a single String field. + * This is used to simulate the DataTypeScenario concept from numeric aggregation tests, + * but fixed for the STRING data type. + */ + protected FluentQueryTest.DeclaringTable getDeclaringTable(boolean enableColumnBasedNullHandling) { + return FluentQueryTest.withBaseDir(_baseDir) + .givenTable( + new Schema.SchemaBuilder() + .setSchemaName("testTable") + .setEnableColumnBasedNullHandling(enableColumnBasedNullHandling) + .addSingleValueDimension("myField", FieldSpec.DataType.STRING) + .build(), SINGLE_FIELD_TABLE_CONFIG); + } + + @Test + public void testFunctionBasics() { + ExpressionContext expression = RequestContextUtils.getExpression("column"); + MinStringAggregationFunction function = new MinStringAggregationFunction(Collections.singletonList(expression), + false); + + // Test function type + assertEquals(function.getType(), AggregationFunctionType.MINSTRING); + + // Test string comparisons + assertEquals(function.merge("apple", "banana"), "apple"); + assertEquals(function.merge("banana", "apple"), "apple"); + assertEquals(function.merge("", "apple"), ""); + assertEquals(function.merge("apple", ""), ""); Review Comment: For MAXSTRING, the merge of "apple" and empty string should return "apple" (lexicographically larger), not empty string. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
