Skip to main content

validate_view_definition

Function validate_view_definition 

Source
pub async fn validate_view_definition(
    def: &ViewDefinition,
    view: &SqlBatchView,
    factory: &Arc<ViewFactory>,
    runtime: Arc<RuntimeEnv>,
    lake: Arc<DataLakeConnection>,
    session_configurator: Arc<dyn SessionConfigurator>,
) -> Result<(Vec<Arc<dyn View>>, Vec<ViewMetadata>), Error>
Expand description

Every check runs before a definition’s row is written, in this one function shared by the DDL executor and the registry loader – so a definition the loader would skip can never be accepted at CREATE time in the first place. view must already be the result of build_sql_batch_view over def – constructing it is most of the validation (it plans the extract query and yields the schema every check below inspects). factory is the factory view was built against – every other definition, for the DDL executor, or the definitions the registry loader has folded in so far – which the update-group ordering check and the on-demand source collection below read.

Returns, for SqlBatchView::with_on_demand_sources, the on-demand views the definition reads (a daemon-updated definition may not read one) and the metadata of every view its extract_query alone scans, daemon-maintained ones included: the merge and count queries can scan tables the extract never reads, and those bytes are not read by a materialization step.