BigQuery 表格¶
大綱¶
可確認授予 BigQuery 權限後可查詢的資料集與表格種類,以及各表格的用途與主要欄位。
BigQuery 權限申請與存取方法,請參閱 BigQuery 設定。
| 資料集 | 說明 |
|---|---|
habq-storage.analytics_N_live | 正式環境資料。在正式環境申請權限後即可查詢 |
habq-storage.analytics_N_sandbox | 沙盒環境資料。在沙盒環境申請權限後即可查詢 |
Note
存取 BigQuery 時,只會顯示已獲授權的資料集。不需另外確認 N 的值。
表格清單¶
表格依用途分為事件表格與服務表格。
| 分類 | 說明 |
|---|---|
| 事件表格 | 作為指標資料來源的表格與隔離表格。分析或確認資料時直接查詢的表格 |
| 服務表格 | 為了建立事件表格,或支援控制台與分析功能而產生的表格。不需直接查詢,僅供參考 |
事件表格¶
| 表格 | 說明 |
|---|---|
t_raw_event_log | (指標資料來源)所有事件日誌一起儲存的原始表格 |
t_raw_event_log_rescue | 將違反傳輸規則而無法儲存至 t_raw_event_log 的日誌原樣保存的隔離表格 |
t_aggregation_index | (指標資料來源)為另外提供累計指標而彙總的最終結果 |
服務表格¶
服務表格並非用於直接查詢的表格。提供作為了解資料產生方式的參考。
| 表格 | 說明 |
|---|---|
t_aggregation_login_master | 用於建立 t_aggregation_index 的中間彙總表格。記錄每位登入使用者(userId)首次出現的日期(用於彙總累計使用者) |
t_aggregation_terms_master | 用於建立 t_aggregation_index 的中間彙總表格。記錄每台同意條款的裝置(deviceId)首次出現的日期(用於彙總累計安裝數) |
t_aggregation_buyer_master | 用於建立 t_aggregation_index 的中間彙總表格。記錄每位付款使用者(userId)首次出現的日期(用於彙總累計付費者) |
t_aggregation_prerelease_revenue | 依日期與條件預先計算遊戲正式上市日之前所產生營收的表格(僅在有上市前營收時才有資料) |
tmp_aggregation_stg_* | 僅在彙總期間存在的暫存表格(建立 1 天後自動刪除) |
system_custom_event_user_state | 用於將資料反映至 t_raw_event_log 的中間彙總表格。依使用者與事件儲存首次與最後一次發生的時間與屬性 |
system_derived_event_* | 記錄衍生事件產生作業進度的內部處理表格 |
meta_event | 所擁有的事件清單 |
meta_event_dimension | 各事件的屬性定義(屬性名稱、資料類型、來源) |
meta_event_dimension_value | 屬性實際收集到的值(字串類型為值的清單;數值與時間類型為最小值~最大值範圍) |
meta_event_latest_date | 各事件的最後資料日期 |
system_attribute_raw | 用於建立 meta_event_dimension_value 的原始屬性清單。attributes JSON 中除了管道產生的 hiveAttributes 以外的所有屬性與值,以及各值的收集次數與首次、最後收集時間 |
segment_* / snapshot_* | 在控制台建立的區隔與快照結果({type}_{number}_{datetime}_{random} 格式;每次都會建立新表格) |
表格詳細資訊¶
事件表格¶
t_raw_event_log¶
儲存從遊戲傳送之所有事件日誌的表格。每一列代表「誰(userId)/ 在哪台裝置(deviceId)/ 在哪個遊戲(appIdGroup)/ 何時(dateTime)/ 以什麼屬性(attributes)/ 做了什麼(eventName)」。
欄位結構與 attributes JSON 的詳細屬性,請參閱事件儲存結構。
t_raw_event_log_rescue¶
將無法儲存至 t_raw_event_log 的日誌原樣保存的隔離表格。具有與 t_raw_event_log 相同的欄位,另外加上原始字串(rawData)、隔離原因(errorReason)與詳細資訊(errorStackTrace)。
- 僅在有隔離日誌時才會建立。
- 由於無效的值也必須保留,
dateTime會以 STRING 而非 TIMESTAMP 儲存。 - 若在
t_raw_event_log中看不到資料,請先確認此表格。
隔離原因與解決方法,請參閱事件儲存結構的資料隔離。
t_aggregation_index¶
為另外提供累計指標而彙總並儲存原始日誌的表格。與 t_raw_event_log 一同作為指標的資料來源。累計使用者等計算不重複人數的指標,會以中間彙總表格的結果為基準儲存。每一列代表「某遊戲 / 某日期 / 某期間類型 / 某指標 / 某條件」的一個值。
| 欄位 | 說明 | 範例 |
|---|---|---|
appIdGroup | 遊戲識別碼 | com.sample.test |
dateTime | 目標日期 | 2026-10-04 |
periodType | 期間類型。day(當日)、cumulative(整個期間累計) | day |
aggName | 指標群組。agg_users(登入)、agg_sales(營收)、agg_terms(安裝) | agg_sales |
dimKey | 條件軸。* 代表該軸的所有值 | country=*\|market=*\|serverId=* |
attributes | 儲存實際指標值的 JSON(measure 下各指標的值) | measure.au, measure.revenue, measure.pu |
checksum | 用於識別該列的雜湊值 |
指標值位於 attributes JSON 中而非欄位中,因此請使用 JSON_VALUE 查詢。
SELECT JSON_VALUE(attributes, '$.measure.revenue') AS revenue
FROM `habq-storage.analytics_N_live.t_aggregation_index`
WHERE aggName = 'agg_sales'
AND periodType = 'cumulative'
AND appIdGroup = 'com.sample.test' -- 實際使用的 appIdGroup
AND dimKey = 'country=*|market=*|serverId=*' -- 整體合計
AND DATE(dateTime) = '2026-10-04'
Warning
即使是相同日期與指標,也會依 dimKey 存在「全部」、「韓國」、「韓國 × Google Play」等多個列。整體合計請只查詢所有軸皆為 * 的那一列。若將多個列相加,會導致重複計算。
服務表格¶
服務表格僅供參考,不需直接查詢。
t_aggregation_*_master¶
用於建立 t_aggregation_index 的中間彙總表格,只記錄每位使用者或每台裝置首次出現的日期。用於彙總累計使用者等無法依日期相加的不重複人數,彙總結果會儲存在 t_aggregation_index 中。
| 表格 | 對象 | 指標 |
|---|---|---|
t_aggregation_login_master | 登入的使用者(userId) | agg_users 累計使用者 |
t_aggregation_terms_master | 同意條款的裝置(deviceId) | agg_terms 累計安裝數 |
t_aggregation_buyer_master | 付款的使用者(userId) | agg_sales 累計付費者 |
| 欄位 | 說明 |
|---|---|
appIdGroup | 遊戲識別碼 |
userId / deviceId | 對象識別碼 |
country, market (serverId) | 首次出現時的國家與市場(t_aggregation_buyer_master 另包含伺服器) |
firstSeenDate / firstSeenAt | 首次出現的日期 / 時間 |
updatedAt | 該列最後更新的時間 |
Note
這些表格只會新增使用者與裝置,不會刪除。此外,在彙總時間之後才延遲送達的資料不會被反映。因此,以這些表格為基準的累計指標,可能與從原始日誌重新計算的值不同。
system_custom_event_user_state¶
用於將資料反映至 t_raw_event_log 的中間彙總表格。依使用者與事件,以一列儲存首次與最後一次發生的時間與屬性。
| 欄位 | 說明 |
|---|---|
userId | 以帳號為基準的使用者識別碼 |
deviceId | 以裝置為基準的使用者識別碼 |
appIdGroup | 遊戲識別碼 |
eventName | 事件名稱 |
firstEventTime, firstAttributes | 首次發生的時間與當時的屬性 |
lastEventTime, lastAttributes | 最後一次發生的時間與當時的屬性 |
meta_event¶
所擁有的事件清單。每一列代表一個事件。
| 欄位 | 說明 |
|---|---|
eventName | 事件名稱 |
dataSource | 事件流入的路徑(custom_server、custom_sdk 等) |
tableName | 儲存事件資料的表格名稱 |
meta_event_dimension¶
各事件的屬性定義。每一列代表事件的一個屬性。
| 欄位 | 說明 |
|---|---|
eventName | 事件名稱 |
dimensionName | 屬性名稱 |
dataType | 屬性的資料類型 |
attributeSource | 屬性儲存的區域(hiveAttributes 或 eventAttributes) |
meta_event_dimension_value¶
屬性實際收集到的值。字串類型儲存值的清單;數值與時間類型儲存最小值~最大值範圍。
| 欄位 | 說明 |
|---|---|
key | 屬性名稱 |
value | 收集到的值(數值與時間類型為最小值與最大值) |
dataType | 屬性的資料類型 |
valueType | 值的儲存方式(值的清單或最小值~最大值範圍) |
meta_event_latest_date¶
各事件的最後資料日期。
| 欄位 | 說明 |
|---|---|
lastDataDate | 有資料的最後日期 |
sourceTable | 確認該日期的來源表格 |
system_attribute_raw¶
用於建立 meta_event_dimension_value 的原始屬性清單。整理 attributes JSON 中除了管道產生的 hiveAttributes 以外的所有屬性與值。
| 欄位 | 說明 |
|---|---|
eventName, appIdGroup | 事件與遊戲 |
key, value | 屬性名稱與收集到的值 |
dataType | 屬性的資料類型 |
valueCount | 該值被收集的次數 |
firstTime, lastTime | 首次與最後收集時間 |
attributeSource | 屬性儲存的區域(hiveAttributes 或 eventAttributes) |
dataSource | 事件流入的路徑 |
注意事項 & Tips¶
t_raw_event_log與t_aggregation_index以dateTime為基準進行每日分區。為降低查詢費用,請一併指定日期條件。