diff --git a/posthog/queries/column_optimizer/foss_column_optimizer.py b/posthog/queries/column_optimizer/foss_column_optimizer.py index 320bd8ef27c67..c998d92480b5a 100644 --- a/posthog/queries/column_optimizer/foss_column_optimizer.py +++ b/posthog/queries/column_optimizer/foss_column_optimizer.py @@ -77,6 +77,8 @@ def columns_to_query( column = get_materialized_column_for_property(table, table_column, property_name) if column is not None and not column.is_nullable: column_names.add(column.name) + else: + column_names.add(table_column) return column_names @cached_property