Skip to main content

ExportConfig

Struct ExportConfig 

Source
pub struct ExportConfig {
Show 41 fields pub name: String, pub query: Option<String>, pub query_file: Option<String>, pub table: Option<String>, pub mode: ExportMode, pub cursor_column: Option<String>, pub cursor_fallback_column: Option<String>, pub incremental_cursor_mode: IncrementalCursorMode, pub chunk_column: Option<String>, pub chunk_dense: bool, pub chunk_size: usize, pub chunk_size_memory_mb: Option<u64>, pub chunk_count: Option<usize>, pub chunk_by_days: Option<u32>, pub chunk_by_key: Option<String>, pub parallel: usize, pub time_column: Option<String>, pub time_column_type: TimeColumnType, pub days_window: Option<u32>, pub partition_by: Option<String>, pub partition_granularity: PartitionGranularity, pub format: FormatType, pub compression: CompressionType, pub compression_level: Option<u32>, pub compression_profile: Option<CompressionProfile>, pub skip_empty: bool, pub destination: DestinationConfig, pub verify: VerifyMode, pub meta_columns: MetaColumns, pub quality: Option<QualityConfig>, pub max_file_size: Option<String>, pub chunk_checkpoint: bool, pub chunk_max_attempts: Option<u32>, pub tuning: Option<TuningConfig>, pub source_group: Option<String>, pub reconcile_required: bool, pub columns: HashMap<String, String>, pub target: Option<String>, pub on_schema_drift: SchemaDriftPolicy, pub shape_drift_warn_factor: Option<f64>, pub parquet: Option<ParquetConfig>,
}

Fields§

§name: String§query: Option<String>§query_file: Option<String>§table: Option<String>

Shortcut for query: "SELECT * FROM <schema>.<table>".

Accepts table or schema.table with ASCII-only identifiers ([A-Za-z_][A-Za-z0-9_]*). Generates an unquoted single-table query so the Postgres NUMERIC catalog-hint resolver recognises it and auto-types numeric(p,s) columns without manual overrides.

Mutually exclusive with query and query_file.

§mode: ExportMode§cursor_column: Option<String>§cursor_fallback_column: Option<String>

Secondary column for IncrementalCursorMode::Coalesce only (see ADR-0007).

§incremental_cursor_mode: IncrementalCursorMode

How primary (and optional fallback) columns drive incremental progression.

§chunk_column: Option<String>§chunk_dense: bool§chunk_size: usize§chunk_size_memory_mb: Option<u64>

Target memory budget per chunk in MB. When set, chunk_size is derived from this budget at plan-build time using a pg_class row-size estimate (pg_relation_size / reltuples), clamped to [10_000, 5_000_000] rows.

Mutually exclusive with an explicit non-default chunk_size:. Only applies to mode: chunked on a Postgres source using the table: shortcut (the row-size probe needs a known relation).

exports:
  - name: page_views
    table: public.page_views
    mode: chunked
    chunk_size_memory_mb: 256
§chunk_count: Option<usize>

Divide the column range into exactly this many equal chunks. Mutually exclusive with chunk_dense and chunk_by_days. When set, chunk_size is computed dynamically from min/max.

§chunk_by_days: Option<u32>§chunk_by_key: Option<String>

Keyset (seek) pagination on this single index-backed unique key — the source-safe shape for tables without a single-integer PK (OPT-4). The column MUST be backed by a usable index (PK or unique); the planner refuses a non-indexed key rather than emit a full-scan + filesort query.

§parallel: usize§time_column: Option<String>§time_column_type: TimeColumnType§days_window: Option<u32>§partition_by: Option<String>

Value-based output partitioning: split this export’s rows into one destination sub-prefix per distinct bucket of this column’s value (Hive-style col=value/ layout). The bucket width is partition_granularity. Requires a {partition} token in destination.path / destination.prefix.

Orthogonal to mode: each partition runs the export’s own mode, so mode: chunked chunks within a day. Rows whose partition column is NULL land in col=__HIVE_DEFAULT_PARTITION__/ (Hive default partition) so no row is silently dropped. Not compatible with mode: time_window.

exports:
  - name: events
    table: events
    partition_by: created_at
    partition_granularity: day
    destination:
      type: s3
      bucket: my-bucket
      prefix: "events/{partition}/"   # → events/created_at=2023-01-01/
§partition_granularity: PartitionGranularity

Bucket width for partition_by. Default day.

§format: FormatType§compression: CompressionType§compression_level: Option<u32>§compression_profile: Option<CompressionProfile>§skip_empty: bool§destination: DestinationConfig§verify: VerifyMode

Integrity depth required of --validate for this export’s parts. size (default) accepts size-only verification; content requires every part’s content MD5 to be checked against the store’s listing (no download) and fails validation for any part that could only be size-verified — e.g. a part too large to upload as a single PUT (raise max_file_size down so it fits), or a backend that exposes no checksum.

§meta_columns: MetaColumns§quality: Option<QualityConfig>§max_file_size: Option<String>§chunk_checkpoint: bool§chunk_max_attempts: Option<u32>§tuning: Option<TuningConfig>§source_group: Option<String>

Optional logical group for shared source capacity (replica, host). Advisory prioritization only.

§reconcile_required: bool

Hint (Epic C / ADR-0006) that this export should always be treated as reconcile-heavy by planning, independent of the --reconcile CLI flag. Advisory only.

§columns: HashMap<String, String>

Per-column type overrides (roadmap §8). Keys are column names; values are short type strings such as decimal(18,2), timestamp_tz, json.

exports:
  - name: payments
    columns:
      amount: decimal(18,2)
      fee: decimal(18,6)
      created_at: timestamp_tz

Overrides take priority over autodetection and are validated at plan time — an invalid type string fails before the export runs.

§target: Option<String>

Downstream warehouse this export targets (bigquery / bq, duckdb). When set, rivet check --type-report resolves each column against it (native type, honest autoload type, recovery hint) without needing --target on the CLI — the CLI flag still wins when both are present. The Parquet interchange stays target-neutral (ADR-0014 T2); target: only drives guidance and the future load-schema artifact.

exports:
  - name: payments
    target: bigquery
§on_schema_drift: SchemaDriftPolicy

Policy applied when structural schema drift is detected (column added, removed, or retyped). Defaults to warn: log a warning and continue.

§shape_drift_warn_factor: Option<f64>

Growth-factor threshold for data shape drift warnings (Epic 8). When a string/binary column’s max observed byte length in the current run exceeds stored_max * shape_drift_warn_factor, Rivet logs a warning. None uses the default of 2.0. Set to 0.0 to disable shape tracking.

§parquet: Option<ParquetConfig>

Parquet row group tuning. Only meaningful when format: parquet. When absent, the parquet library default (1,048,576 rows/group) is used.

Implementations§

Source§

impl ExportConfig

Source

pub fn effective_compression(&self) -> (CompressionType, Option<u32>)

Resolve the effective (CompressionType, level) for this export. compression_profile takes precedence over compression + compression_level.

Source

pub fn max_file_size_bytes(&self) -> Option<u64>

Source

pub fn resolve_query( &self, config_dir: &Path, params: Option<&HashMap<String, String>>, ) -> Result<String>

Trait Implementations§

Source§

impl Clone for ExportConfig

Source§

fn clone(&self) -> ExportConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExportConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ExportConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ExportConfig

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more