From 90f0b08e97d4c95f037fbeff29a863e3585c61bb Mon Sep 17 00:00:00 2001 From: kenkooooo Date: Wed, 15 Jul 2026 11:53:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20max=5Fstreaks=20=E3=81=AE=E4=BA=8C?= =?UTF-8?q?=E9=87=8D=E3=82=BF=E3=82=A4=E3=83=A0=E3=82=BE=E3=83=BC=E3=83=B3?= =?UTF-8?q?=E5=A4=89=E6=8F=9B=E3=81=AB=E3=82=88=E3=82=8B=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=82=AF=E8=A8=88=E7=AE=97=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `AT TIME ZONE 'UTC'` の後に `AT TIME ZONE 'Asia/Tokyo'` を連鎖させると、 一度naiveなtimestampに変換された値を「これはJSTの時刻表記だ」と再解釈して しまい、意図した+9時間ではなく-9時間の変換になっていた。 結果、UTC 9-15時台(JSTの夜、コンテスト時間帯)に行われた提出だけ 偶然日付が一致し、それ以外の時間帯(日中の精進や早朝の提出など)は solve_date が1日ずれて計算され、本来連続しているストリークが streak_groups の判定で途切れてしまっていた。 Fixes #1549 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015rK811gLsFrY6BiaZYYUW7 --- dbt/models/marts/max_streaks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/models/marts/max_streaks.sql b/dbt/models/marts/max_streaks.sql index a97453e81..67b48e219 100644 --- a/dbt/models/marts/max_streaks.sql +++ b/dbt/models/marts/max_streaks.sql @@ -15,7 +15,7 @@ daily_solves as ( -- Convert to JST date (epoch + 9 hours, then truncate to day) select distinct user_id, - (to_timestamp(first_ac_epoch) at time zone 'UTC' at time zone 'Asia/Tokyo')::date as solve_date + (to_timestamp(first_ac_epoch) at time zone 'Asia/Tokyo')::date as solve_date from first_ac_per_problem ),