Overview of Schemas
A schema is a skeleton structure that represents the logical view of the dataset. The dataset can be a file, table, or a SQL query in a database. A schema defines how the data is structured and organized. Schema information includes:
- Column names
- Column ordering
- Column data types
Schemas may apply to relational tables and schematized file formats such as Avro and Parquet.
Input type conversions
Depending on the data source, Trifacta® can read in native data types into Trifacta data types. For more information, see Type Conversions.
Over time, schema sources may change in major and minor ways, often without warning. From within the Trifacta application, schema changes may appear as broken recipe steps and can cause data corruption downstream. To assist with these issues, the Trifacta application can be configured to monitor schema changes on your dataset. Schema validation performs the following actions on your dataset:
- On read, the schema information from the dataset is captured and stored separately in the Trifacta database. This information identifies column names, data types, and ordering of the dataset.
When the dataset is read during job execution, the new schema information is read and compared to the stored version, which enables identification of changes to the dataset.
Tip: This check occurs as the first step of the job execution process and is labeled as Schema validation.
You can configure the Trifacta application to halt job execution when schema validation issues have been encountered.
Tip: Configuration settings can be overridden for individual jobs.
Schema validation applies only to sources that have published schemas (relational datasources and schematized file types).
NOTE: CSV files are not supported.
NOTE: If you attempt to refresh the schema of a parameterized dataset based on a set of files, only the schema for the first file is checked for changes. If changes are detected, the other files are contain those changes as well. This can lead to changes being assumed or undetected in later files and potential data corruption in the flow.
At the project or workspace level, an administrator can set the default settings for outputs to validate schemas or not.
Tip: Workspace-level defaults can be overridden at the job level, even if the workspace-level settings are disabled. For more information, see Run Job Page.
For more information, see Workspace Settings Page.
When schema validation is enabled and a job is launched, the schema validation check is performed in parallel with the data ingestion step. The results of the schema validation check are reported in the Job Details page in the Schema validation stage.
NOTE: Jobs may be configured to fail if schema validation checks fail. If jobs are not configured to fail, jobs may complete with warnings and publish output data to the specified targets, when schema validation fails.
For more information, see Job Details Page.
When schema validation detects differences in the Job Details page, those findings can be explored in detail. See Schema Changes Dialog.
You can override the project or workspace level settings for schema validation for individual jobs. For more information, see Run Job Page.
In the Job Details page, you can review schema validation checks for the datasets in the job. For more information, see Job Details Page.
NOTE: Delimiter files include CSVs and TSVs and can include other files whose delimiters can be inferred by the Trifacta application during import. Delimited files do not contain data type information; data types are inferred by the Trifacta application for these file types.
NOTE: File types that require conversion, such as Excel, PDF, and JSON, are not supported.
- Reduces challenges of replacing datasets and retaking samples.
NOTE: If you attempt to refresh the schema of a parameterized dataset based on a set of files, only the schema for the first file is checked for changes. If changes are detected, the other files are assumed to contain those changes as well. This can lead to changes being assumed or undetected in later files and potential data corruption in the flow.
- You cannot refresh the schemas of reference datasets or uploaded sources.
Schema refresh does not apply to any file formats that require conversion to native formats.
NOTE: Schema management does not work for JSON-based imported datasets that were created under the v1 legacy method of JSON import. All JSON imported datasets created under the legacy method (v1) of JSON import must be recreated to behave like v2 datasets with respect to conversion and schema management. Features developed in the future may not retroactively be supported in the v1 legacy mode. For more information, see Working with JSON v2.
- If a column's data type is modified and other changes, such as column name changes, are not detected, this change is not considered a schema drift error.
Effects of refreshing schemas
When you choose to refresh a schema, the schema is refreshed without checking for changes, which forces the invalidation of all samples and recollection of a new initial sample. Other samples must be recreated. In some environments, this sample collection incurs costs.
When you refresh the schema in the Trifacta application:
- All the existing samples are invalidated.
- Addition or removal of columns may cause recipe steps to break, which can cause any transformation jobs to fail. You must fix these broken steps in the Recipe panel.
Refresh your schemas
For more information on how to refresh the schemas of your datasets, see:
Output type conversions
Depending on the output system, Trifacta can deliver your results in columns and data types native to the target. For more information, see Type Conversions.
As needed, you can import a dataset the columns of which can serve as the target of your transformation efforts. When this target schema is imported, it is super-imposed on the columns of your dataset in the Transformer page, allowing you to quickly change the naming, order, and data typing of your columns to match the target schema. For more information, see Overview of RapidTarget.
This page has no comments.