def _check_aggregation(exp: Expression) -> bool:
    if isinstance(exp, BinaryExpression):
        if isinstance(exp.left, Function):
            return True
        if isinstance(exp.right, Function):
            return True
        if (isinstance(exp.left, Expression) and _check_aggregation(exp.left)):
            return True
        if (isinstance(exp.right, Expression) and _check_aggregation(exp.right)):
            return True
    return False
def _check_aggregation(exp: Expression) -> bool:
    if isinstance(exp, BinaryExpression):
        if isinstance(exp.left, Function):
            return True
        if isinstance(exp.right, Function):
            return True
        if (isinstance(exp.left, Expression) and _check_aggregation(exp.left)):
            return True
        if (isinstance(exp.right, Expression) and _check_aggregation(exp.right)):
            return True
    return False