RWM Console cluster: risingwave-ai-hub-int.ai-hub-rwm.svc.cluster.local

← cluster insights objects accruals_agg_mv
Overview Objects Graph History
materialized view · insights.accruals_agg_mv Explain plan ▶
Parallelism
2
Actors
32 / 32
running
Distribution
HASH
Rows
2,646
State size
397.9 KiB
Created
2026-08-25 12:32
Initialized
2026-08-25 12:31
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
164538 19486 33 running
164539 19486 33 running
164540 19488 33 running
164541 19488 33 running
164542 19493 33 running
164543 19493 33 running
164544 19483 33 running
164545 19483 33 running
164546 19485 33 running
164547 19485 33 running
164548 19489 33 running
164549 19489 33 running
+ 20 more actor(s) (32 running)
sql · insights.accruals_agg_mv — click to expand
CREATE MATERIALIZED VIEW insights.accruals_agg_mv AS
SELECT
  a.account_id,
  a.asset_id,
  a.fact_date AS dim_value_date,
  COALESCE(h.currency_code, a.currency) AS currency_code,
  CASE WHEN a.type = 'EXPENSE' THEN 'LIABILITY' ELSE 'ASSET' END AS type,
  SUM(
    a.amount * COALESCE(
      fx_accrual.rate,
      CASE WHEN a.currency = COALESCE(h.currency_code, a.currency) THEN 1 ELSE NULL END
    )
  ) AS accrued_amount,
  SUM(
    a.amount * COALESCE(fx_sys.rate, CASE WHEN a.currency = 'USD' THEN 1 ELSE NULL END)
  ) AS accrued_value_system_currency
FROM olap.accruals_ft AS a
LEFT JOIN insights.holding_values_raw_mv AS h
  ON h.account_id = a.account_id
  AND h.asset_id = a.asset_id
  AND h.dim_value_date = a.fact_date
  AND h.type = CASE WHEN a.type = 'EXPENSE' THEN 'LIABILITY' ELSE 'ASSET' END
LEFT JOIN asset_service.foreign_exchange_rates_eod_ft AS fx_accrual
  ON fx_accrual.source_currency_code = a.currency
  AND fx_accrual.target_currency_code = COALESCE(h.currency_code, a.currency)
  AND fx_accrual.date = a.fact_date
LEFT JOIN asset_service.foreign_exchange_rates_eod_ft AS fx_sys
  ON fx_sys.source_currency_code = a.currency
  AND fx_sys.target_currency_code = 'USD'
  AND fx_sys.date = a.fact_date
WHERE
  NOT a.is_included
  AND (
    NOT fx_accrual.rate IS NULL OR a.currency = COALESCE(h.currency_code, a.currency)
  )
  AND (
    NOT fx_sys.rate IS NULL OR a.currency = 'USD'
  )
GROUP BY
  a.account_id,
  a.asset_id,
  a.fact_date,
  COALESCE(h.currency_code, a.currency),
  CASE WHEN a.type = 'EXPENSE' THEN 'LIABILITY' ELSE 'ASSET' END
Lineage · insights.accruals_agg_mv 6 objects
Direct (1-hop) dependencies from rw_depend, across schemas. Click a neighbor to expand its dependencies; ⌘/Ctrl-click opens its page. Drag to pan, scroll to zoom. External source/sink endpoints (Kafka, Iceberg) are not shown.