Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #7
0
 def visit_lambda(self, exp: Lambda) -> Expression:
     return apply_mappers(exp, self.__translation_rules.lambdas, self)
Beispiel #8
0
 def visit_argument(self, exp: Argument) -> Expression:
     return apply_mappers(exp, self.__translation_rules.arguments, self)
Beispiel #9
0
 def visit_curried_function_call(self, exp: CurriedFunctionCall) -> Expression:
     return apply_mappers(exp, self.__translation_rules.curried_functions, self)
Beispiel #10
0
 def visit_subscriptable_reference(self, exp: SubscriptableReference) -> Expression:
     return apply_mappers(exp, self.__translation_rules.subscriptables, self)
Beispiel #11
0
 def visit_column(self, exp: Column) -> Expression:
     return apply_mappers(exp, self.__translation_rules.columns, self)
Beispiel #12
0
 def visit_literal(self, exp: Literal) -> Expression:
     return apply_mappers(exp, self.__translation_rules.literals, self)