How do you handle schema evolution within your data pipelines?
Write a SQL query that compares the latest two registered schema versions for each pipeline and identifies columns whose definition changed. Include newly added or removed columns, data type changes, and nullability changes.
pipeline_name, column_name, change_type, previous_data_type, current_data_type, previous_is_nullable, and current_is_nullable.pipeline_name, then column_name.| Column | Type | Description |
|---|---|---|
| version_idPK | INT | Unique schema version identifier |
| pipeline_name | VARCHAR(100) | Name of the data pipeline |
| version_number | INT | Increasing version number within a pipeline |
| registered_at | DATE | Date the schema version was registered |
| Column | Type | Description |
|---|---|---|
| column_idPK | INT | Unique schema column record identifier |
| version_id | INT | Schema version containing the column |
| column_name | VARCHAR(100) | Column name |
| data_type | VARCHAR(50) | Declared SQL data type |
| is_nullable | BOOLEAN | Whether the column accepts NULL values |