class KnnMatch extends Scalar<Boolean, Object> {

    public static void register(Functions.Builder module) {
        module.add(
            Signature.scalar(
                "knn_match",
                TypeSignature.parse(FloatVectorType.NAME),
                TypeSignature.parse(FloatVectorType.NAME),
                DataTypes.INTEGER.getTypeSignature(),
                DataTypes.BOOLEAN.getTypeSignature()
            ),
            KnnMatch::new
        );
    }

    public KnnMatch(Signature signature, BoundSignature boundSignature) {
        super(signature, boundSignature);
    }

    @Override
    @SafeVarargs
    public final Boolean evaluate(TransactionContext txnCtx,
                                  NodeContext nodeContext,
                                  Input<Object>... args) {<FILL_FUNCTION_BODY>}

    @Override
    @Nullable
    public Query toQuery(Function function, Context context) {
        List<Symbol> args = function.arguments();
        if (args.get(0) instanceof Reference ref
                && args.get(1) instanceof Literal<?> targetLiteral
                && args.get(2) instanceof Literal<?> kLiteral) {

            Object target = targetLiteral.value();
            Object k = kLiteral.value();
            if (target instanceof float[] && k instanceof Integer) {
                return new KnnFloatVectorQuery(ref.storageIdent(), (float[]) target, (int) k);
            }
            return null;
        }
        return null;
    }

}

        throw new UnsupportedOperationException("knn_match can only be used in WHERE clause for tables as it needs an index to operate on");
    
<methods>public BoundSignature boundSignature() ,public Scalar<java.lang.Boolean,java.lang.Object> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract java.lang.Boolean evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<java.lang.Object>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature