RWM Console cluster: risingwave-adib.adib-rw.svc.cluster.local

← cluster insights objects flow_by_asset_mv
Overview Objects Graph History
materialized view · insights.flow_by_asset_mv
Parallelism
2
Actors
10 / 10
running
Distribution
HASH
Rows
0
State size
Created
2026-06-30 21:53
Initialized
2026-06-30 21:53
Fragment flags
MVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
55049 3008 3 running
55050 3008 3 running
55051 3009 3 running
55052 3009 3 running
55053 3010 3 running
55054 3010 3 running
55055 3011 3 running
55056 3011 3 running
55057 3012 3 running
55058 3012 3 running
sql · insights.flow_by_asset_mv — click to expand
CREATE MATERIALIZED VIEW insights.flow_by_asset_mv AS
SELECT
  account_group_id,
  dim_transaction_date,
  asset_id,
  asset_currency,
  position_type,
  currency_code,
  adjusted_net_flow,
  adjusted_net_flow_system_currency,
  adjusted_net_flow_asset_currency,
  SUM(adjusted_net_flow) OVER w AS cumulative_adjusted_netflow,
  SUM(adjusted_net_flow_system_currency) OVER w AS cumulative_adjusted_netflow_system_currency,
  SUM(adjusted_net_flow_asset_currency) OVER w AS cumulative_adjusted_netflow_asset_currency
FROM (
  SELECT
    pre.account_group_id,
    pre.dim_transaction_date,
    pre.asset_id,
    pre.asset_currency,
    CASE WHEN GROUPING(pre.position_type) = 1 THEN 'POSITION' ELSE pre.position_type END AS position_type,
    pre.group_currency AS currency_code,
    SUM(pre.net_value_group) AS adjusted_net_flow,
    SUM(pre.net_value_system) AS adjusted_net_flow_system_currency,
    SUM(
      pre.net_value * COALESCE(
        fx_asset.rate,
        CASE WHEN pre.transaction_currency = pre.asset_currency THEN 1 ELSE NULL END
      )
    ) AS adjusted_net_flow_asset_currency
  FROM (
    SELECT
      account_group_id,
      dim_transaction_date,
      asset_id,
      asset_currency,
      transaction_currency,
      position_type,
      group_currency,
      SUM(net_value_group) AS net_value_group,
      SUM(net_value_system) AS net_value_system,
      SUM(net_value) AS net_value
    FROM insights.flow_values_mv
    GROUP BY
      account_group_id,
      dim_transaction_date,
      asset_id,
      asset_currency,
      transaction_currency,
      position_type,
      group_currency
  ) AS pre
  LEFT JOIN asset_service.foreign_exchange_rates_eod_ft AS fx_asset
    ON fx_asset.source_currency_code = pre.transaction_currency
    AND fx_asset.target_currency_code = pre.asset_currency
    AND fx_asset.date = pre.dim_transaction_date
  WHERE
    NOT fx_asset.rate IS NULL OR pre.transaction_currency = pre.asset_currency
  GROUP BY
    GROUPING SETS (
      (
        pre.account_group_id,
        pre.dim_transaction_date,
        pre.asset_id,
        pre.asset_currency,
        pre.position_type,
        pre.group_currency
      ),
      (
        pre.account_group_id,
        pre.dim_transaction_date,
        pre.asset_id,
        pre.asset_currency,
        pre.group_currency
      )
    )
  HAVING
    GROUPING(pre.position_type) = 1 OR NOT pre.position_type IS NULL
) AS grouped
WINDOW w AS (
  PARTITION BY account_group_id, asset_id, position_type
  ORDER BY dim_transaction_date
)
Lineage · insights.flow_by_asset_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.