Skip to content

Commit

Permalink
fix: log missing rows
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Dec 19, 2024
1 parent 0300e33 commit cfae721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ def get_query_log_from_clickhouse(report, query_contexts, print_sql, fail_on_err
# Run CH query until results for all slices are returned
ch_count = 6
while ch_count > 0:
if ch_chart_result["queries"][0]["rowcount"] < chart_count:
logger.info("Waiting for clickhouse log...")
missing_rows = chart_count - ch_chart_result["queries"][0]["rowcount"]
if missing_rows > 0:
logger.info(f"Waiting for {missing_rows} clickhouse logs...")
time.sleep(5)
ch_chart_result = measure_chart(slice, query_context, fail_on_error)
ch_count -= 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sql: |
query,
http_user_agent
FROM system.query_log
WHERE databases <> ['system'] AND (http_user_agent LIKE 'aspects-%') AND (type = 'QueryFinish')
WHERE (has(databases, '{{ASPECTS_XAPI_DATABASE}}') OR has(databases, '{{ASPECTS_EVENT_SINK_DATABASE}}') OR has(databases, '{{DBT_PROFILE_TARGET_DATABASE}}')) AND (http_user_agent LIKE 'aspects-%') AND (type = 'QueryFinish')
ORDER BY event_time DESC
table_name: query_log
template_params: null
Expand Down

0 comments on commit cfae721

Please sign in to comment.