ReOrc docs
Get ReOrc
English
English
  • About ReOrc
  • Set up and deployment
    • Set up organization
    • Install ReOrc agent
  • Getting started
    • 1. Set up a connection
      • BigQuery setup
    • 2. Create a project
    • 3. Create data models
    • 4. Build models in console
    • 5. Set up a pipeline
  • Connections
    • Destinations
      • Google Service Account
    • Integrations
      • Slack
  • Data modeling
    • Overview
    • Sources
    • Models
      • Model schema
      • Model configurations
    • Jinja templating
      • Variables
      • Macros
    • Materialization
    • Data lineage
    • Data tests
      • Built-in generic tests
      • Custom generic tests
      • Singular tests
  • Semantic modeling
    • Overview
    • Data Modelling vs Semantic Layer
    • Cube
      • Custom Dimension
      • Custom Measure
        • Aggregation Function
        • SQL functions and operators
        • Calculating Period-over-Period Changes
      • Relationship
    • View
      • Primary Dimension
      • Add Shared Fields
    • Shared Fields
    • Integration
      • Guandata Integration
      • Looker Studio
  • Pipeline
    • Overview
    • Modeling pipeline
    • Advanced pipeline
    • Job
  • Health tracking
    • Pipeline health
    • Data quality
  • Data governance
    • Data protection
  • Asset management
    • Console
    • Metadata
    • Version history
    • Packages and dependencies
  • DATA SERVICE
    • Overview
    • Create & edit Data Service
    • Data preview & download
    • Data sharing API
    • Access control
  • AI-powered
    • Rein AI Copilot
  • Settings
    • Organization settings
    • Project settings
    • Profile settings
    • Roles and permissions
  • Platform Specific
    • Doris/SelectDB
Powered by GitBook
On this page
  1. Data modeling
  2. Models

Model schema

PreviousModelsNextModel configurations

Last updated 15 days ago

A SQL model is essentially constructed as a SELECT statement. The results generated from a model produce a table with columns, each having specific names and data types based on the transformations you define within the model.

You can define a model schema, which serves as a description of how the resulting data should be structured—similar to a table schema in a relational database.

Defining a schema for your model offers two primary benefits:

  • Description: Team members can easily understand the expected structure of the data by reviewing the schema without having to run a preview.

  • Structural enforcement: In the ReOrc data pipeline, other assets such as data tests or cubes refer directly to the model schema to understand the model's structure. This schema serves as the single definition of the structure, ensuring alignment across all implementations. Therefore, maintaining a consistent and well-defined schema is essential.

Define a model schema

To define the schema for a SQL model, follow these steps:

  1. Open a SQL model in the editor.

  2. Switch to the Fields tab.

  3. Generate the schema:

    For quick generation, you can click on Generate Schema. ReOrc will produce the schema results, including column names, data types, and suggested descriptions (generated by our AI).

  4. Verify and adjust the schema.

    After generation, you can rename fields (column names), modify data types, or adjust descriptions to improve clarity.