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