mz_compute_types/
sources.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Types for describing dataflow sources.
11
12use mz_repr::SqlRelationType;
13use serde::{Deserialize, Serialize};
14
15/// A description of an instantiation of a source.
16///
17/// This includes a description of the source, but additionally any
18/// context-dependent options like the ability to apply filtering and
19/// projection to the records as they emerge.
20#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
21pub struct SourceInstanceDesc<M> {
22    /// Arguments for this instantiation of the source.
23    pub arguments: SourceInstanceArguments,
24    /// Additional metadata used by the storage client of a compute instance to read it.
25    pub storage_metadata: M,
26    /// The relation type of this source
27    pub typ: SqlRelationType,
28}
29
30/// Per-source construction arguments.
31#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
32pub struct SourceInstanceArguments {
33    /// Linear operators to be applied record-by-record.
34    pub operators: Option<mz_expr::MapFilterProject>,
35}