Ejemplo n.º 1
0
def test_invalid_call(query: Query) -> None:
    processor = CustomFunction(
        "f_call",
        [("param1", ColType({String})), ("param2", ColType({UInt}))],
        simple_function("f_call_impl(param1, inner_call(param2))"),
    )
    with pytest.raises(InvalidCustomFunctionCall):
        processor.process_query(query, HTTPQuerySettings())
Ejemplo n.º 2
0
def apdex_processor() -> CustomFunction:
    return CustomFunction(
        "apdex",
        [("column", ColType({UInt})), ("satisfied", LiteralType({int}))],
        simple_function(
            "divide(plus(countIf(lessOrEquals(column, satisfied)), divide(countIf(and(greater(column, satisfied), lessOrEquals(column, multiply(satisfied, 4)))), 2)), count())"
        ),
    )