Repository: risingwavelabs/risingwave
File: src/stream/src/common/table/test_state_table.rs (Rust)

Code before:
        column_descs.clone(),
        order_types.clone(),
        pk_index.clone(),
        read_prefix_len_hint,
    );

    test_env.register_table(table.clone()).await;

    // Attach metrics to verify vnode pruning effectiveness
    let registry = Registry::new();
    let metrics = StreamingMetrics::new(&registry, MetricLevel::Debug).new_state_table_metrics(
        TEST_TABLE_ID,
        ActorId::new(1),
        FragmentId::new(1),
    );

    // Build state table with vnode stats enabled
    let vnode_bitmap = {
        let mut builder = BitmapBuilder::zeroed(VirtualNode::COUNT_FOR_TEST);
        for i in 0..VirtualNode::COUNT_FOR_TEST {
            builder.set(i, true);
        }
        builder.finish()
    };
    let mut config = StreamingConfig::default();
    config.developer.enable_state_table_vnode_stats_prunning = true;
    let mut state_table: StateTable<HummockStorage> = StateTableBuilder::new(
        &table,
        test_env.storage.clone(),
        Some(Arc::new(vnode_bitmap)),
    )
    .enable_vnode_key_stats(true, &Arc::new(config))
    .with_metrics(metrics)
    .forbid_preload_all_rows()
    .build()
    .await;

    let mut epoch = EpochPair::new_test_epoch(test_epoch(1));
    test_env
        .storage
        .start_epoch(epoch.curr, HashSet::from_iter([TEST_TABLE_ID]));
    state_table.init_epoch(epoch).await.unwrap();

    // Insert some rows
    state_table.insert(OwnedRow::new(vec![
        Some(1_i32.into()),
        Some(11_i32.into()),
        Some(111_i32.into()),
    ]));

    state_table.insert(OwnedRow::new(vec![

Review comment (suggestion):
Spelling error: "prunning" should be "pruning" (single 'n'). This affects the field access which should be `enable_state_table_vnode_stats_pruning` instead of `enable_state_table_vnode_stats_prunning`.
```suggestion
    config.developer.enable_state_table_vnode_stats_pruning = true;
```

Code after:
        column_descs.clone(),
        order_types.clone(),
        pk_index.clone(),
        read_prefix_len_hint,
    );

    test_env.register_table(table.clone()).await;

    // Attach metrics to verify vnode pruning effectiveness
    let registry = Registry::new();
    let metrics = StreamingMetrics::new(&registry, MetricLevel::Debug).new_state_table_metrics(
        TEST_TABLE_ID,
        ActorId::new(1),
        FragmentId::new(1),
    );

    // Build state table with vnode stats enabled
    let vnode_bitmap = {
        let mut builder = BitmapBuilder::zeroed(VirtualNode::COUNT_FOR_TEST);
        for i in 0..VirtualNode::COUNT_FOR_TEST {
            builder.set(i, true);
        }
        builder.finish()
    };
    let mut config = StreamingConfig::default();
    config.developer.enable_state_table_vnode_stats_pruning = true;
    let mut state_table: StateTable<HummockStorage> = StateTableBuilder::new(
        &table,
        test_env.storage.clone(),
        Some(Arc::new(vnode_bitmap)),
    )
    .enable_vnode_key_stats(true, &Arc::new(config))
    .with_metrics(metrics)
    .forbid_preload_all_rows()
    .build()
    .await;

    let mut epoch = EpochPair::new_test_epoch(test_epoch(1));
    test_env
        .storage
        .start_epoch(epoch.curr, HashSet::from_iter([TEST_TABLE_ID]));
    state_table.init_epoch(epoch).await.unwrap();

    // Insert some rows
    state_table.insert(OwnedRow::new(vec![
        Some(1_i32.into()),
        Some(11_i32.into()),
        Some(111_i32.into()),
    ]));

    state_table.insert(OwnedRow::new(vec![