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

← cluster insights objects flow_by_asset_mv
Overview Objects Graph History
materialized view · insights.flow_by_asset_mv Explain plan ▶
Parallelism
2
Actors
16 / 16
running
Distribution
HASH
Rows
9,641
State size
2.3 MiB
Created
2026-08-19 22:48
Initialized
2026-08-19 22:48
Fragment flags
LOCALITY_PROVIDERMVIEWSNAPSHOT_BACKFILL_STREAM_SCANSTREAM_SCAN
Actors
ActorFragmentWorkerState
739481 61581 51 running
739482 61581 51 running
739485 61582 51 running
739486 61582 51 running
739487 61584 51 running
739488 61584 51 running
739489 61583 51 running
739490 61583 51 running
739491 61585 51 running
739492 61585 51 running
739493 61586 51 running
739494 61586 51 running
+ 4 more actor(s) (16 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 AS flow_values_mv_next
    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 7 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.