Crossfield / Documentation
Crossfield documentation
Run a reporting example, build a semantic model, or connect an application to approved business definitions.
Crossfield lets teams maintain business calculations in a model and query them through DuckDB. These guides show how to use a model, explain a result, and review changes to the rules behind a report.
Crossfield will ship as part of Haybarn, Query Farm’s DuckDB distribution. To run the examples before that release, request evaluation access for a matching development engine and Crossfield extension. The example downloads contain data and models; the binaries are supplied separately. See release details and build requirements.
Start with a reporting question
| Your question | What you will learn | Start here |
|---|---|---|
| Are customers receiving complete orders on time? | Define which orders count, query the delivery rate, and compare original with revised promises. | Fulfillment walkthrough |
| How much exposure are we reporting, and which positions count? | Query gross and net exposure, combine exposure with limits, and review a broader reporting scope. | Investment walkthrough |
| Why does joining receipt lines change a revenue total? | Combine measures from different levels of detail without counting an order’s revenue more than once. | Retail orders and line items |
Each guide starts with the source records and includes complete model files, runnable SQL, expected answers and captured explanations. You can also browse all example downloads.
New to semantic layers? How it works follows a reporting definition from a business decision into SQL.
Write queries against an existing model
Start with ATTACH in the example setup, then choose metrics and dimensions with FROM SEMANTIC. The query guide covers detail rows, named reports, typed inputs and joins between models.
Use discovery functions to find available definitions and accepted arguments. Use EXPLAIN (SEMANTIC) to inspect the selected rules and generated SQL before executing a report.
Build and maintain a model
- Describe your tables and reporting rules. Decide what each row represents, which records count and how each metric is calculated.
- Understand Apache Ossie’s role. Separate the shared model format from Crossfield’s execution policy.
- Validate the model. Check its structure and source references, then test its numerical results.
- Review a new model version. Compare definitions against the same data before changing reports.
Build an application or AI workflow
The AI-agent guide follows discovery, explanation and a rejected query through a recorded session. The discovery reference lists the metadata interfaces for models, metrics, signatures and reports.
Choose a connection mode for the intended workflow. Applications that must prevent callers from changing the approved model or mode also need host-controlled sessions. Authentication and source access remain application responsibilities.
Handle more specialized reporting
| Requirement | Guide |
|---|---|
| Ask for a repository or organization without writing provider calls | Typed inputs and model-owned retrieval |
| Assign rainfall or other interval measurements to the period they represent | Time and measurements |
| Understand why query checks need engine support | Crossfield in Haybarn |
| Check a build or provider’s recorded qualification | Availability and limits |