From 0bd753d5d65a6185b1cf8a0109dea87c008610b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Thu, 28 Mar 2024 16:10:26 +0100 Subject: [PATCH] fix(hogql): reverse join order for actors --- posthog/hogql_queries/actors_query_runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posthog/hogql_queries/actors_query_runner.py b/posthog/hogql_queries/actors_query_runner.py index 93e9f40c70739..215c7ed183165 100644 --- a/posthog/hogql_queries/actors_query_runner.py +++ b/posthog/hogql_queries/actors_query_runner.py @@ -142,11 +142,11 @@ def source_table_join(self) -> ast.JoinExpr: source_alias = "source" return ast.JoinExpr( - table=ast.Field(chain=[self.strategy.origin]), + table=source_query, + alias=source_alias, next_join=ast.JoinExpr( - table=source_query, + table=ast.Field(chain=[self.strategy.origin]), join_type="INNER JOIN", - alias=source_alias, constraint=ast.JoinConstraint( expr=ast.CompareOperation( op=ast.CompareOperationOp.Eq,