Skip to content

Commit 73f2f1b

Browse files
committed
Define operand type for DISTINCT_COUNT_APPROX
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 2286eab commit 73f2f1b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.calcite.sql.fun.SqlLibrary;
3333
import org.apache.calcite.sql.fun.SqlLibraryOperatorTableFactory;
3434
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
35+
import org.apache.calcite.sql.type.OperandTypes;
3536
import org.apache.calcite.sql.type.ReturnTypes;
3637
import org.apache.calcite.sql.type.SqlTypeName;
3738
import org.apache.calcite.sql.util.ListSqlOperatorTable;
@@ -58,6 +59,7 @@
5859
import org.opensearch.sql.expression.function.BuiltinFunctionName;
5960
import org.opensearch.sql.expression.function.PPLBuiltinOperators;
6061
import org.opensearch.sql.expression.function.PPLFuncImpTable;
62+
import org.opensearch.sql.expression.function.UDFOperandMetadata;
6163
import org.opensearch.sql.opensearch.client.OpenSearchClient;
6264
import org.opensearch.sql.opensearch.executor.protector.ExecutionProtector;
6365
import org.opensearch.sql.opensearch.functions.DistinctCountApproxAggFunction;
@@ -302,7 +304,7 @@ private void registerOpenSearchFunctions() {
302304
DistinctCountApproxAggFunction.class,
303305
BuiltinFunctionName.DISTINCT_COUNT_APPROX.name(),
304306
ReturnTypes.BIGINT_FORCE_NULLABLE,
305-
null);
307+
UDFOperandMetadata.wrap(OperandTypes.ANY));
306308
PPLFuncImpTable.INSTANCE.registerExternalAggOperator(
307309
BuiltinFunctionName.DISTINCT_COUNT_APPROX, approxDistinctCountFunction);
308310
OperatorTable.addOperator(

0 commit comments

Comments
 (0)