Skip to main content

read_data_product

Function read_data_product 

Source
async fn read_data_product(
    client: &mut AuthedClient,
    name: &str,
    limit: u32,
    cluster_override: Option<&str>,
    max_response_size: usize,
) -> Result<McpResult, McpRequestError>
Expand description

Read rows from a data product. Issues a single read-only query.

By default the read is routed to the cluster recorded in the data product catalog (mz_mcp_data_products.cluster), so reads of indexed views actually hit the index’s in-memory arrangement instead of falling back to a full recompute through persist on whatever cluster the session happens to default to. cluster_override bypasses that routing and runs the same read on a named cluster instead — useful for running the read on a differently-sized or differently-replicated cluster.

Without an override, the role must have USAGE on the catalog cluster — otherwise the call fails with McpRequestError::ClusterPrivilegeMissing rather than silently degrading to a slower path that would mask the missing privilege.

The name is expected to come from get_data_products() / get_data_product_details(). The query runs inside a READ ONLY transaction, preventing mutations.