MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / import_view_into_dataflow

Method import_view_into_dataflow

src/adapter/src/optimize/dataflows.rs:394–406  ·  view source on GitHub ↗

Imports the view with the specified ID and expression into the provided dataflow description. [`OptimizerFeatures`] is used while running expression [`mz_transform::analysis::Analysis`]. You should generally prefer calling [`DataflowBuilder::import_into_dataflow`], which can handle objects of any type as long as they exist in the catalog. This method exists for when the view does not exist in the

(
        &mut self,
        view_id: &GlobalId,
        view: &OptimizedMirRelationExpr,
        dataflow: &mut DataflowDesc,
        features: &OptimizerFeatures,
    )

Source from the content-addressed store, hash-verified

392 /// when the view does not exist in the catalog, e.g., because it is
393 /// identified by a [`GlobalId::Transient`].
394 pub fn import_view_into_dataflow(
395 &mut self,
396 view_id: &GlobalId,
397 view: &OptimizedMirRelationExpr,
398 dataflow: &mut DataflowDesc,
399 features: &OptimizerFeatures,
400 ) -> Result<(), OptimizerError> {
401 for get_id in view.depends_on() {
402 self.import_into_dataflow(&get_id, dataflow, features)?;
403 }
404 dataflow.insert_plan(*view_id, view.clone());
405 Ok(())
406 }
407
408 // Re-optimize the imported view plans using the current optimizer
409 // configuration if reoptimization is requested.

Callers 5

optimizeMethod · 0.80
optimizeMethod · 0.80
optimizeMethod · 0.80
import_into_dataflowMethod · 0.80
optimizeMethod · 0.80

Calls 4

import_into_dataflowMethod · 0.80
insert_planMethod · 0.80
depends_onMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected