Пример #1
0
    def visit_lambda(self, exp: Lambda) -> Expression:
        if exp in self.__cache:
            return self.__cache[exp]

        ret = apply_mappers(exp, self.__translation_rules.lambdas, self)
        self.__cache[exp] = ret
        return ret
Пример #2
0
    def visit_function_call(self, exp: FunctionCall) -> Expression:
        if exp in self.__cache:
            return self.__cache[exp]

        ret = apply_mappers(exp, self.__translation_rules.functions, self)
        self.__cache[exp] = ret
        return ret
Пример #3
0
    def visit_argument(self, exp: Argument) -> Expression:
        if exp in self.__cache:
            return self.__cache[exp]

        ret = apply_mappers(exp, self.__translation_rules.arguments, self)
        self.__cache[exp] = ret
        return ret
Пример #4
0
    def visit_column(self, exp: Column) -> Expression:
        if exp in self.__cache:
            return self.__cache[exp]

        ret = apply_mappers(exp, self.__translation_rules.columns, self)
        self.__cache[exp] = ret
        return ret
Пример #5
0
 def visit_literal(self, exp: Literal) -> Expression:
     # We can't use the cache for literals because Python hashes
     # Literal(None, 0) and Literal(None, 0.0) equivalently, which can then
     # break Clickhouse since it expects the correct type. This isn't a major
     # performance hit though since Literals can't contain other expressions.
     ret = apply_mappers(exp, self.__translation_rules.literals, self)
     return ret
Пример #6
0
    def visit_subscriptable_reference(
            self, exp: SubscriptableReference) -> Expression:
        if exp in self.__cache:
            return self.__cache[exp]

        ret = apply_mappers(exp, self.__translation_rules.subscriptables, self)
        self.__cache[exp] = ret
        return ret
Пример #7
0
 def visit_lambda(self, exp: Lambda) -> Expression:
     return apply_mappers(exp, self.__translation_rules.lambdas, self)
Пример #8
0
 def visit_argument(self, exp: Argument) -> Expression:
     return apply_mappers(exp, self.__translation_rules.arguments, self)
Пример #9
0
 def visit_curried_function_call(self, exp: CurriedFunctionCall) -> Expression:
     return apply_mappers(exp, self.__translation_rules.curried_functions, self)
Пример #10
0
 def visit_subscriptable_reference(self, exp: SubscriptableReference) -> Expression:
     return apply_mappers(exp, self.__translation_rules.subscriptables, self)
Пример #11
0
 def visit_column(self, exp: Column) -> Expression:
     return apply_mappers(exp, self.__translation_rules.columns, self)
Пример #12
0
 def visit_literal(self, exp: Literal) -> Expression:
     return apply_mappers(exp, self.__translation_rules.literals, self)