Skip to content

Commit

Permalink
Makes log_comment,is_initial_query and type not visible in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
orian committed Dec 11, 2024
1 parent 9c6729f commit 8e0558a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions posthog/hogql/database/schema/query_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)

QUERY_LOG_FIELDS: dict[str, FieldOrTable] = {
"query_id": StringDatabaseField(name="query_id"), #
"query_id": StringDatabaseField(name="query_id"),
"query": StringDatabaseField(name="query"), #
"query_start_time": DateTimeDatabaseField(name="event_time"), #
"query_duration_ms": FloatDatabaseField(name="query_duration_ms"), #
Expand All @@ -25,18 +25,19 @@
"result_bytes": IntegerDatabaseField(name="result_bytes"),
"memory_usage": IntegerDatabaseField(name="memory_usage"),
"status": StringDatabaseField(name="type"),
"log_comment": StringDatabaseField(name="log_comment"),
"kind": StringDatabaseField(name="kind"),
"query_type": StringDatabaseField(name="query_type"),
"is_personal_api_key_request": BooleanDatabaseField(name="is_personal_api_key_request"),
# below fields are used in condition and cannot be removed
}

RAW_QUERY_LOG_FIELDS: dict[str, FieldOrTable] = QUERY_LOG_FIELDS | {
# below fields are necessary to compute some of the resulting fields
"type": StringDatabaseField(name="type"),
"is_initial_query": BooleanDatabaseField(name="is_initial_query"),
# "query_1": ExpressionField(name="query_1", ),
"log_comment": StringDatabaseField(name="log_comment"),
}

STRING_FIELDS = {
"cache_key": ["cache_key"],
"query_type": ["query_type"],
"query_id": ["client_query_id"],
"query": ["query", "query"],
Expand Down Expand Up @@ -119,7 +120,7 @@ def get_alias(name, chain):


class RawQueryLogTable(FunctionCallTable):
fields: dict[str, FieldOrTable] = QUERY_LOG_FIELDS
fields: dict[str, FieldOrTable] = RAW_QUERY_LOG_FIELDS

name: str = "raw_query_log"

Expand Down

0 comments on commit 8e0558a

Please sign in to comment.