Search in sources :

Example 1 with ImposeOrderFunction

use of com.hazelcast.jet.sql.impl.aggregate.function.ImposeOrderFunction in project hazelcast by hazelcast.

the class HazelcastSqlValidator method countOrderingFunctions.

private static int countOrderingFunctions(SqlNode node) {
    class OrderingFunctionCounter extends SqlBasicVisitor<Void> {

        int count;

        @Override
        public Void visit(SqlCall call) {
            SqlOperator operator = call.getOperator();
            if (operator instanceof ImposeOrderFunction) {
                count++;
            }
            return super.visit(call);
        }
    }
    OrderingFunctionCounter counter = new OrderingFunctionCounter();
    node.accept(counter);
    return counter.count;
}
Also used : ImposeOrderFunction(com.hazelcast.jet.sql.impl.aggregate.function.ImposeOrderFunction) SqlCall(org.apache.calcite.sql.SqlCall) SqlOperator(org.apache.calcite.sql.SqlOperator) SqlBasicVisitor(org.apache.calcite.sql.util.SqlBasicVisitor)

Aggregations

ImposeOrderFunction (com.hazelcast.jet.sql.impl.aggregate.function.ImposeOrderFunction)1 SqlCall (org.apache.calcite.sql.SqlCall)1 SqlOperator (org.apache.calcite.sql.SqlOperator)1 SqlBasicVisitor (org.apache.calcite.sql.util.SqlBasicVisitor)1