Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 46b85ee

Browse files
AndreyPavlenkoienkovich
authored andcommitted
Support TopK aggregate in Calcite
Signed-off-by: Andrey Pavlenko <[email protected]>
1 parent 8086560 commit 46b85ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

omniscidb/Calcite/java/calcite/src/main/java/com/mapd/calcite/parser/MapDSqlOperatorTable.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ public static void addUDF(
251251
null,
252252
OperandTypes.or(OperandTypes.INTEGER, OperandTypes.BINARY),
253253
SqlFunctionCategory.NUMERIC));
254+
opTab.addOperator(new SqlAggFunction("TOP_K",
255+
null,
256+
SqlKind.OTHER_FUNCTION,
257+
ReturnTypes.ARG0_NULLABLE,
258+
null,
259+
OperandTypes.family(SqlTypeFamily.NUMERIC, SqlTypeFamily.NUMERIC),
260+
SqlFunctionCategory.SYSTEM,
261+
false,
262+
false,
263+
Optionality.FORBIDDEN) {
264+
});
254265
if (extSigs == null) {
255266
return;
256267
}

0 commit comments

Comments
 (0)