Data modeling conventions for analytics pipelines using Arrow columnar interchange, DuckDB/DuckLake lakehouse patterns, SQLMesh transformations, and scientific data contracts. Loads when designing database structures or data pipelines.
Ships in preferences-data-and-scientific-computing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This document covers data modeling for data pipelines and analytics using Apache Arrow as the in-memory interchange format, DuckDB as the query engine, DuckLake for lakehouse catalog management, and SQLMesh for data transformation and build orchestration.
What this document covers:
What this document does not cover:
The key distinction is that this document is about modeling data at rest (tables, schemas, metrics) and data in motion (Arrow record batches, IPC, cross-language interchange) while domain-modeling.md is about modeling domain logic (entities, workflows, state transitions).
For application domain modeling using functional programming patterns, see:
Data schemas are contracts. Treat them as type signatures that make implicit assumptions explicit.
SELECT *)Data transformations should behave as pure functions where practical.
Once written, data files should never be modified in place.
Schema changes should be transactional and backward-compatible when possible.
Validate data shape and constraints at system boundaries.
For comprehensive guidance on modeling domain types and error handling, see:
preferences-algebraic-data-types — sum types (discriminated unions), product types, newtype pattern, making illegal states unrepresentablepreferences-railway-oriented-programming — Result types, bind/apply composition, effect signatures, two-track modelKey principles from ADT design:
Within a sufficiently expressive specification language (Lean 4 or Idris 2, the QMADTT-expressive tier, whose type-theoretic grounding is owned by preferences-theoretical-foundations and whose tier placement is set by preferences-computational-system-taxonomy) types split by how they lower to each target, a split worth naming the lowering-path bifurcation. Domain-direct types are the sum-rich domain and implementation algebra that the transforms pattern-match on; they lower directly to each target language (Rust enums, Python Expression tagged unions) with no intermediate schema language, and are owned by preferences-domain-modeling, whose verified Lean-to-Rust leg is refinement-driven-development. Schema-factored types are the product-oriented columnar, table, and record data-schema types (data we ingest or derive through transformation), and these factor through a schema-first multi-target binding generator, LinkML, where one YAML schema mechanically emits pydantic, SQL DDL, JSON Schema, protobuf, and TypeScript bindings on demand, plus an ontology overlay (SHACL, OWL, and RDF emission, with ontology binding via class_uri, slot_uri, and CURIE-bound enums). LinkML belongs to the same codegen-from-one-schema family as sqlc; see preferences-schema-versioning for that toolchain. The two arms exist because of a sum-versus-product expressiveness gap: frame-based and relational schemas cannot faithfully carry exhaustiveness-checked discriminated sums (A + B + C), so sums stay domain-direct and only product-oriented schemas factor through LinkML. The legs are also epistemically asymmetric, in that a schema-to-bindings lowering is mechanical and drift-checkable, whereas an upstream-spec-to-schema projection (when one exists) is not necessarily a witnessed functor. That asymmetry yields the projection caveat: when an upstream structural source of truth exists, a data or table schema is a projection of it, not the root. The spec-anchored instance of this bifurcation, with Lean as the structural source of truth projecting to a LinkML skeleton and on to a single Arrow oracle, is the Nucleus pattern; see nucleus-platform for that instance rather than restating its mechanism here.
When processing event data, partition by time to enable efficient incremental updates.
INCREMENTAL_BY_TIME_RANGE or equivalent patterns for time-series dataMake data pipeline state explicit and queryable.
For modeling pipeline execution states (Pending, Running, Completed, Failed), consider using state machine patterns from domain-modeling.md's state machines for entity lifecycles section. This applies to job status tracking, data quality checks, and orchestration workflows.
In this section semantic layer means the BI and metrics sense: business logic (metrics, dimensions) separated from physical storage. This is a distinct sense from the ontology and CURIE-binding overlay (SHACL, OWL, RDF) that LinkML emits for the schema-factored arm of the lowering-path bifurcation above; both senses are legitimate, and the term should be read from context.
Separate business logic (metrics, dimensions) from physical storage schema.
Build complex metrics from simpler, reusable components.
Apache Arrow is the in-memory columnar format that makes DuckDB zero-copy across language runtimes. This is the foundational architectural choice connecting the query engine (DuckDB), on-disk storage (Parquet and its successors), and computational consumers across Python, Julia, and Rust.
Arrow record batches serve as the universal in-memory interchange format. DuckDB query results are natively Arrow-backed through the C Data Interface, which means results cross language boundaries without serialization or copying. Parquet files memory-map to Arrow with predicate pushdown, so the transition from storage to compute avoids unnecessary materialization. Arrow IPC enables efficient cross-process and cross-language data transfer, and GPU streaming via Arrow IPC or GDS/KvikIO saturates GPU compute without CPU-side bottlenecks.
The practical consequence is that any consumer that speaks Arrow — whether a Python dataframe library, a Julia differential equations solver, or a Rust web server — can receive query results from DuckDB with zero intermediate representation. This makes Arrow the lingua franca of the analytics stack rather than a format choice for any single language ecosystem.
DuckDB provides first-class bindings that all produce Arrow record batches through the same C Data Interface. The bindings vary in maturity and ecosystem integration but share the same zero-copy Arrow output path.
duckdb package, the most mature binding with tight pandas and polars integrationDuckDB.jl (duckdb/DuckDB.jl), enabling Julia's SciML ecosystem (DiffEq.jl, Lux.jl, KernelAbstractions.jl) to consume lakehouse data directly as Arrow record batchesduckdb-rs (duckdb/duckdb-rs) for embedded analytics, and async-duckdb (jessekrubin/async-duckdb) for async web application serving via axumAll three language ecosystems benefit equally from the DuckDB-to-Arrow pipeline. A single DuckLake catalog can serve Python notebooks running probabilistic inference, Julia processes solving differential equations, and Rust services delivering query results over HTTP — all consuming the same Arrow record batches without format translation.
Read models and materialized views in analytics architectures form a Galois connection with the underlying event log or source data. The projection from events to views is information-lossy but composable; views are quotients of the source data under an equivalence relation. Query caching is memoization over the query profunctor, with cache invalidation governed by naturality conditions. DuckLake's time-travel capability implements temporal versioning as indexed types, connecting to the bitemporal semantics described in event sourcing. See preferences-theoretical-foundations references/abstraction-as-adjunction.md for the order-theoretic model in which a best abstraction, when one exists, is the left adjoint of a Galois connection.
Store catalog metadata in SQL databases, not file-based catalogs.
Leverage DuckDB's strengths for analytical workloads.
Bridge local DuckDB development with production deployments.
DuckLake provides ACID transactions without running a database server, implementing an embedded lakehouse pattern where the catalog is a DuckDB database and data lives in columnar files.
Zero-copy table registration via CREATE TABLE ... WITH NO DATA registers external schemas without materializing data, which is useful for schema-only integration with existing Parquet file collections.
The DATA_PATH sentinel controls where materialized data lives, separating catalog state from data storage location.
The ducklake:hf:// protocol enables direct catalog access to HuggingFace-hosted datasets.
For SQLMesh integration, use a separate DuckLake state connection to keep the transformation engine's internal state isolated from the catalog being built. This avoids contention between SQLMesh's plan/apply lifecycle and DuckLake's ACID transactions on the same catalog.
DuckDB's httpfs extension enables predicate pushdown over remote Parquet files, meaning only the relevant row groups and columns are transferred over the network.
The hf:// protocol provides native access to HuggingFace Hub datasets without downloading full files locally.
This enables server-side DuckDB architectures where a web application queries remote DuckLake catalogs and streams Arrow record batches to clients, avoiding the need for browsers or client applications to download full datasets. Combined with DuckLake's catalog metadata, the query planner can prune partitions and push predicates before any data crosses the network boundary.
Parquet is the current standard on-disk columnar format and the default for DuckLake data storage. Two emerging formats extend the columnar ecosystem in complementary directions.
Vortex (vortex-data/vortex) is an emerging successor to Parquet with improved compression and query performance.
DuckDB already supports native Vortex read and write, though DuckLake's catalog implementation does not yet support Vortex as a storage backend.
Lance (used by slaf-project/slaf) is an Arrow-native format optimized for ML and vector workloads.
DuckDB supports Lance via extension, and Lance files are lakehouse-compatible.
The practical stance is Parquet today, with Vortex and Lance as they mature. DuckDB's native support for all three formats means the transition is transparent to query consumers — the Arrow record batches they receive are identical regardless of which on-disk format backs the data.
Choose appropriate model kinds for different use cases.
SEED - for static reference data loaded from filesINCREMENTAL_BY_TIME_RANGE - for time-partitioned event dataVIEW - for logical transformations without materializationFULL - for complete refresh of derived tablesTest changes safely before affecting production.
Build data quality checks into model definitions.
Data artifacts from scientific and computational workflows benefit from columnar storage and DuckDB queryability when they follow consistent structural conventions.
Simulation ensembles produce millions of (parameter, observation) pairs where observations may be variable-length time series. Arrow list and struct columns naturally represent these variable-length trajectories without flattening to a fixed grid, and DuckDB's nested type support means the data is directly queryable without denormalization.
Diagnostic tables — SBC ranks, z-scores, contractions, calibration metrics — are inherently tabular with one row per (dataset_id, parameter). These are the simplest case: flat columnar tables that DuckDB processes efficiently and that translate directly to diagnostic visualizations.
Posterior samples are tabular with (sample_id, parameter columns), directly queryable for summary statistics, quantiles, and convergence diagnostics. Storing these as Parquet partitioned by model version enables time-travel queries across model iterations.
Model provenance registries track which artifacts belong to which model version: (model_version, ensemble_path, approximator_path, timestamp, invalidated_by). This is the metadata layer that connects simulation outputs, trained approximators, and diagnostic results into a queryable lineage graph.
Experimental design sweep results follow the pattern (design_config, parameter, metric_value), enabling cross-configuration queries to identify which experimental designs yield the best inference performance.
See preferences-scalable-probabilistic-modeling-workflow section 06 for diagnostic threshold definitions and paradigm-specific applicability.
The concrete operational stack consists of three components: SQLMesh for data build and transformation, DuckDB with DuckLake for catalog management and query, and HuggingFace Hub with git-xet/git-lfs for data hosting and distribution. This combination provides a serverless lakehouse where the catalog is a DuckDB file, data lives in Parquet on HuggingFace, and SQLMesh manages the transformation DAG.
Data ingestion (dlt) and workflow orchestration (Dagster) are plausible future additions that could become relevant under certain operational contexts. Neither is part of the current operational stack, and their adoption would depend on whether ingestion complexity or scheduling requirements exceed what SQLMesh provides natively.
Build libraries of reusable data transformations.
Ensure metrics and logic remain consistent across tools.
When modeling data, prioritize:
Remember that data pipelines should make side effects explicit in their signatures and isolate them at boundaries to preserve compositionality, discharging those effects through capability interfaces and handlers rather than committing to any single carrier such as a monad transformer stack. See preferences-theoretical-foundations (and its references/effects-handlers.md) for why a capability interface, not a transformer tower, is the primitive.
For concrete implementation patterns see preferences-railway-oriented-programming (Result types, bind/apply, effect signatures) and preferences-algebraic-data-types (domain modeling with sum/product types).
What SKILL.md sets; muted values are Claude Code's defaults
/preferences-data-and-scientific-computing:preferences-data-modelingfrom preferences-data-and-scientific-computing
npx claudepluginhub cameronraysmith/vanixiets --plugin preferences-data-and-scientific-computing5 skills in this plugin
/preferences-json-queryingJSON querying tools and patterns using DuckDB and jaq for data extraction and transformation. Load when querying JSON data or writing data pipelines./preferences-scalable-probabilistic-modeling-workflowPrincipled Bayesian workflow for simulation-based inference on stochastic dynamical systems, extending Betancourt's iterative methodology with adaptations for implicit likelihoods and amortized neural posterior approximation. Load when doing simulation-based inference, stochastic dynamical systems modeling, amortized inference architecture design, or principled Bayesian workflow planning.
/preferences-scientific-inquiry-methodologyPhilosophical and methodological framework for scientific inquiry grounded in Peircean pragmatism, effective theory construction, and principled iterative model building. Load when reasoning about scientific methodology, model construction and criticism, evidential standards, or the relationship between mechanistic understanding and statistical modeling.
/preferences-workflow-orchestration-algebraAlgebraic and categorical reading of data/pipeline workflow orchestrators (Dagster, Flyte) through the Build Systems à la Carte lens, plus the functional-programming and CCV discipline for the gaps the orchestrator does not enforce itself. Scoped to data-pipeline orchestration, not agent/subagent workflow DAGs. Load when mapping a Dagster asset graph to a free-term / store-interpreter structure, choosing between asset-based and task-based orchestrators, writing a lawful IO manager, reasoning about static-vs-dynamic dependencies in a pipeline, or enforcing type-safe FP discipline on Dagster or Flyte pipelines in Python.
Other plugins' skills for the same job