Skip to main content

teckel-model

The teckel-model crate defines the public domain types for the Teckel pipeline model. It has minimal dependencies (serde, serde_yaml, thiserror) and is designed to be consumed by downstream crates without pulling in heavy parsing machinery.

Crate path: crates/teckel-model/

Re-exports (lib.rs)

pub use asset::{Asset, AssetMetadata, ColumnMetadata, Context};
pub use error::{TeckelError, TeckelErrorCode};
pub use pipeline::Pipeline;
pub use source::Source;
pub use types::AssetRef;

Source enum

The central type. Each variant corresponds to a Teckel asset type.

I/O variants

VariantStructKey fields
InputInputSourceformat, path, options
OutputOutputSourceasset_ref, format, path, mode, options

Core transformations (8.1 -- 8.10)

VariantStructKey fields
SelectSelectTransformfrom, columns: Vec<Expression>
WhereWhereTransformfrom, filter: Condition
GroupByGroupByTransformfrom, by: Vec<Column>, agg: Vec<Expression>
OrderByOrderByTransformfrom, columns: Vec<SortColumn>
JoinJoinTransformleft, right: Vec<JoinTarget>
UnionUnionTransformsources: Vec<AssetRef>, all, by_name, allow_missing_columns
IntersectIntersectTransformsources: Vec<AssetRef>, all, by_name, allow_missing_columns
ExceptExceptTransformleft, right, all, by_name, allow_missing_columns
DistinctDistinctTransformfrom, columns: Option<Vec<Column>>
LimitLimitTransformfrom, count: u64

Extended transformations (8.11 -- 8.31)

VariantStructKey fields
AddColumnsAddColumnsTransformfrom, columns: Vec<ColumnDef>
DropColumnsDropColumnsTransformfrom, columns: Vec<Column>
RenameColumnsRenameColumnsTransformfrom, mappings: BTreeMap<Column, String>
CastColumnsCastColumnsTransformfrom, columns: Vec<CastDef>
WindowWindowTransformfrom, partition_by, order_by, frame, functions
PivotPivotTransformfrom, group_by, pivot_column, values, agg
UnpivotUnpivotTransformfrom, ids, values, variable_column, value_column
FlattenFlattenTransformfrom, separator, explode_arrays
SampleSampleTransformfrom, fraction, with_replacement, seed, bounds
ConditionalConditionalTransformfrom, output_column, branches, otherwise
SplitSplitTransformfrom, condition, pass, fail
SqlSqlTransformquery, views: Vec<AssetRef>
RollupRollupTransformfrom, by, agg
CubeCubeTransformfrom, by, agg
Scd2Scd2Transformcurrent, incoming, key_columns, track_columns, date columns
EnrichEnrichTransformfrom, url, method, key_column, response_column, headers
SchemaEnforceSchemaEnforceTransformfrom, mode, columns: Vec<SchemaColumn>
AssertionAssertionTransformfrom, checks: Vec<QualityCheck>, on_failure
RepartitionRepartitionTransformfrom, num_partitions, columns
CoalesceCoalesceTransformfrom, num_partitions
CustomCustomTransformfrom, component, options

v3 transformations (8.32 -- 8.45)

VariantStructKey fields
OffsetOffsetTransformfrom, count: u64
TailTailTransformfrom, count: u64
FillNaFillNaTransformfrom, columns, value, values
DropNaDropNaTransformfrom, columns, how, min_non_nulls
ReplaceReplaceTransformfrom, columns, mappings: Vec<Replacement>
MergeMergeTransformtarget, source, on, when_matched, when_not_matched
ParseParseTransformfrom, column, format, schema, options
AsOfJoinAsOfJoinTransformleft, right, left_as_of, right_as_of, direction, tolerance
LateralJoinLateralJoinTransformleft, right, join_type, on
TransposeTransposeTransformfrom, index_columns
GroupingSetsGroupingSetsTransformfrom, sets, agg
DescribeDescribeTransformfrom, columns, statistics
CrosstabCrosstabTransformfrom, col1, col2
HintHintTransformfrom, hints: Vec<HintSpec>

TeckelDataType

All supported data types:

TypeRust variantNotes
stringString
integerIntegeralias: int
longLongalias: bigint
floatFloat
doubleDouble
booleanBoolean
dateDate
timestampTimestamp
binaryBinary
decimalDecimal { precision, scale }
arrayArray(Box<TeckelDataType>)
mapMap(Box<TeckelDataType>, Box<TeckelDataType>)
structStruct(Vec<StructField>)
byteBytealias: tinyint (v3)
shortShortalias: smallint (v3)
charChar(u32)v3
varcharVarChar(u32)v3
timestamp_ntzTimestampNtzv3
timeTime(Option<u8>)v3, optional precision
year_month_intervalYearMonthIntervalv3
day_time_intervalDayTimeIntervalv3
variantVariantv3

Pipeline

The top-level output type containing all parsed pipeline data:

FieldTypeDescription
contextContextAll assets keyed by name
metadataPipelineMetadataName, namespace, version, owner, tags, schedule, freshness
configPipelineConfigBackend, cache, notifications
hooksHooksPre/post execution lifecycle hooks
qualityVec<QualitySuite>Data quality suites
templatesVec<Template>Reusable templates
exposuresVec<Exposure>Downstream consumer declarations
streaming_inputsVec<StreamingInput>Streaming input definitions
streaming_outputsVec<StreamingOutput>Streaming output definitions
secretsBTreeMap<String, SecretKey>Secret key declarations

Quality types

Ten check types within QualitySuite:

CheckKey fields
Schemarequired_columns, forbidden_columns, types
Completenesscolumn, threshold, severity, escalate
Uniquenesscolumns, threshold
Validitycolumn, accepted_values, range, pattern, format, length_between, threshold
Statisticalcolumn, mean, min, max, sum, stdev, quantiles
Volumerow_count, column_count
Freshnesscolumn, max_age
Referentialcolumn, reference_asset, reference_column, threshold
CrossColumncondition, description, threshold
Customcondition, description, threshold