Source
Applies to
Platform: Microsoft SQL Server · Snowflake · Snowflake dbt · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Stage · Data Store · Data Vault · Dimensional
A Source describes an object of a source system, such as a table, view or file, with its terms and data types. Use it as the input of a Stage, which reads the source object and loads it into the Stage layer. A Source generates no database objects of its own.
Data Mart projects have no Sources; they read linked objects of other projects.
Create a Source
- From a Discovery of the source system: see Create Source Objects from a Discovery.
- Manually: create a model object of type Source in the Source layer and add its terms with their data types.
A Source has no dataflow and no relationships. To create a Stage from it, open the menu of the Source, choose Automate and then Create Stage.
Properties
A Source has properties only in the Stage generators that read files or use OpenQuery:
- Microsoft SQL Server Stage Files: File Extension, File Group Pattern, Column Collation, Column Delimiter, Row Delimiter, Batch Size, Code Page, Field Quote and First Data Row.
- Databricks and Fabric Lakehouse Stage Files: Column Delimiter, Row Delimiter, Field Quote and the CSV options.
- Snowflake Stage Files: File Name Pattern, and the term property Partition Order that the same article describes.
- Microsoft SQL Server OpenQuery: Native Expression on terms.
A Source that you create from a Discovery of files gets the column delimiter that the Discovery detected.
Default Terms
A Source has no Default Terms. The Stage that reads it adds them, for example BG_LoadTimestamp.
Generated objects
The generator creates no object for a Source. The source view of the Stage reads the source object directly. On Microsoft SQL Server Stage Files, the Stage first loads the file into a raw-data table.
Example
The Source CUSTOMER describes the table CUSTOMER of a source system. On Microsoft SQL Server, the Stage customer reads it in this view, shown with its two Default Terms and four of the ten source terms:
CREATE VIEW [stg].[STG_ST_customer_Source]
AS
SELECT
CAST(NULL AS DATETIMEOFFSET) AS [BG_LoadTimestamp]
,CAST(NULL AS NVARCHAR(255)) COLLATE DATABASE_DEFAULT
AS [BG_SourceSystem]
,[s1].[CUSTOMER_ID] AS [CUSTOMER_ID]
,[s1].[CUSTOMER] COLLATE DATABASE_DEFAULT AS [CUSTOMER]
,[s1].[CUSTOMER_TYPE] COLLATE DATABASE_DEFAULT AS [CUSTOMER_TYPE]
,[s1].[CUSTOMER_SINCE] AS [CUSTOMER_SINCE]
FROM [<source database name>].[<source schema name>].[CUSTOMER] AS [s1]
<source database name> and <source schema name> are the placeholder values of the source system that you set before deployment. stg is the Stage schema of the example. The Stage loader fills BG_LoadTimestamp with the load timestamp. BG_SourceSystem stays empty, because it is not mapped in this Stage.
Related articles
- Next: Stage
- Reference: CSV options (Model Object), File Name Pattern (Model Object), Native Expression (Term), Column Delimiter (Model Object), Batch Size (Model Object)
- See also: Create Source Objects from a Discovery, Update Source Model Objects from a new Import Version, Create a Model Object, Model a Stage Solution