PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Chat - (gpt-5.6)
Token size
4,599
Example input
[WAREHOUSE_PLATFORM_AND_ENVIRONMENT]: Platform: Snowflake Environment: Production Database: ANALYTICS_DB Schema: SALES Deployment: Application team plans schema change during weekend release [CURRENT_SCHEMA]: Table: SALES.ORDERS order_id NUMBER(38,0) NOT NULL customer_id NUMBER(38,0) NOT NULL order_date TIMESTAMP_NTZ NOT NULL order_status VARCHAR(20) NULL total_amount NUMBER(12,2) NOT NULL [DATA_USAGE_AND_QUERY_CONTEXT]: Is order_status is used in filtering. total_amount is aggregated using SUM(). daily_orders_transform runs every night. Historical orders remain in the same table. [BUSINESS_AND_REPORTING_IMPACT]: Sales Dashboard is business-critical. Total Revenue is a key KPI. Completed Orders is used by the operations team. Incorrect revenue values are considered high impact. [MIGRATION_CONSTRAINTS_AND_VALIDATION_REQUIREMENTS]: No planned downtime. Existing consumers must continue working during migration. Historical data must remain usable. Rollback required. Pre-production validation required.
Example output
1. Executive Summary The proposed change contains three significant schema modifications: 1. order_status is removed. 2. status_code is introduced as its replacement. 3. total_amount changes from NUMBER(12,2) to NUMBER(10,0). The removal of order_status is a confirmed breaking change because a known query directly references it. The total_amount change is also high risk because reducing precision and eliminating decimal scale can alter monetary values and potentially produce incorrect revenue calculations. The status_code addition itself is non-breaking, but treating it as an immediate replacement for order_status creates a compatibility problem for existing consumers. Overall migration risk: High The safest approach is a staged migration rather than immediately dropping order_status and changing the monetary column. --- 2. Schema Change Matrix ID Object Current Definition Proposed Definition Change Type Compatibility Severity Priority SC-01 SALES.ORDERS.order_status VARCHAR(20) Removed Removal πŸ”΄ Breaking High P0 SC-02 SALES.ORDERS.status_code Not present VARCHAR(10) Addition 🟒 Non-Breaking Low P2 SC-03 SALES.ORDERS.total_amount NUMBER(12,2) NUMBER(10,0) Type modification πŸ”΄ Breaking / High Risk Critical P0 Key finding status_code being added does not automatically make removal of order_status backward compatible. Existing consumers still depend on the old field. --- 3. Schema-Impact Map SALES.ORDERS.order_status ↓ Known SQL Query ↓ SALES.ORDERS filtering logic ↓ ANALYTICS.FCT_ORDERS ↓ BI.SALES_DASHBOARD ↓ Completed Orders KPI ↓ Operations reporting For total_amount: SALES.ORDERS.total_amount ↓ daily_orders_transform ↓ ANALYTICS.FCT_ORDERS ↓ BI.SALES_DASHBOARD ↓ Total Revenue KPI These relationships are based on the supplied dependency information. They should not be treated as exhaustive lineage. --- 4. Affected Datasets & Queries Object Consumer Dependency Type Failure Mode Impact Confidence Action order_status Known SQL query Direct column reference Query compilation/runtime failure High Confirmed Migrate query order_status FCT_ORDERS Transformation dependency Transformation failure High Confirmed from supplied lineage Update transformation order_status Sales Dashboard Transitive Missing/changed Completed Orders KPI High Confirmed from supplied lineage Validate KPI total_amount daily_orders_transform Direct transformation input Incorrect monetary values / processing issue Critical Confirmed Validate before type change total_amount Total Revenue KPI Analytical aggregation Incorrect revenue Critical Confirmed Reconcile old vs new values --- 5. Breaking Change Register BC-01: Removal of order_status What changes? Current: order_status VARCHAR(20) Proposed: column removed Why does it break? The known query contains: WHERE order_status = 'COMPLETED' After removal, that query can no longer reference the column. Affected consumers Known SQL query ANALYTICS.FCT_ORDERS Sales Dashboard Completed Orders KPI Technical consequence Potential query failure or transformation failure. Business consequence The Completed Orders KPI may become unavailable or incorrect. Required remediation Introduce status_code and migrate consumers before removing order_status. --- 6. Data-Type Compatibility Matrix Field Old Type New Type Risk Potential Failure Migration Requirement Validation order_status VARCHAR(20) Removed High Missing-column failure Consumer migration Query regression status_code N/A VARCHAR(10) Medium Mapping mismatch Define status mapping Value reconciliation total_amount NUMBER(12,2) NUMBER(10,0) Critical Precision loss / changed monetary values Data migration strategy Revenue reconciliation --- 7. Detailed Type Risk: total_amount This is the most important data-quality concern. Current: NUMBER(12,2) allows two decimal places. Example: 1250.75 The proposed: NUMBER(10,0) does not preserve the existing two-decimal scale. Therefore, the migration must establish exactly how existing monetary values should be represented. For example, if: 1250.75 becomes: 1251 then revenue changes. If it becomes: 1250 revenue also changes. The database accepting a conversion would not prove that the business transformation is correct. Required validation Compare: SUM(old_total_amount) against the business-approved representation of: SUM(new_total_amount) for historical and newly migrated records. Do not approve the type change until the monetary representation is explicitly defined. --- 8. Reporting & Analytics Impact Confirmed impact Sales Dashboard Two important areas are affected: Completed Orders KPI Depends on: order_status Removing the field without migrating the logic can break the KPI. Total Revenue KPI Depends on: total_amount Changing monetary precision can alter aggregated revenue. Business impact KPI Risk Reason Completed Orders High Status column is being removed Total Revenue Critical Monetary type is changing Other unknown KPIs Unknown Full BI dependency inventory was not provided --- 9. Migration Gap Register Gap ID Missing Step Why Required Dependency Risk Recommendation GAP-01 Status mapping definition order_status β†’ status_code relationship is not fully specified Status consumers High Define authoritative mapping GAP-02 Consumer migration Existing query references removed field SQL / ETL High Update consumers before removal GAP-03 Monetary conversion rule Decimal values need explicit treatment Revenue pipeline Critical Define approved conversion GAP-04 Historical-data validation Existing records use old representation Historical reporting High Reconcile historical totals GAP-05 BI regression testing Dashboard dependencies need verification Sales Dashboard High Execute KPI regression tests GAP-06 Rollback procedure No detailed rollback mechanism supplied Production deployment High Define rollback trigger and procedure --- 10. Recommended Migration Plan Sequence Action Owner Dependency Risk Validation Rollback 1 Define order_status β†’ status_code mapping Data Engineering None Medium Mapping completeness test N/A 2 Add status_code Data Engineering Step 1 Low Schema test Remove new column 3 Populate status_code for historical data Data Engineering Step 2 High Row/value reconciliation Restore previous state 4 Update ETL/query consumers Analytics Engineering Step 3 High Query + pipeline tests Restore old logic 5 Update BI/semantic logic BI Team Step 4 High KPI reconciliation Revert dashboard logic 6 Validate status_code in production-like environment QA/Data Engineering Steps 3-5 Medium Regression suite Block release 7 Establish monetary conversion rule Data Engineering/Finance owner None Critical Revenue reconciliation Do not deploy 8 Migrate total_amount Data Engineering Step 7 Critical Precision + aggregation tests Restore old representation 9 Monitor consumers Data Platform Steps 4-8 Medium Error/query monitoring Roll back if thresholds fail 10 Remove order_status Data Engineering All previous steps High Dependency scan + regression Restore compatibility layer if required --- 11. Backward / Forward Compatibility Strategy A direct change: Remove order_status Add status_code is not appropriate while old consumers still exist. A safer transition is: Phase 1 order_status + status_code ↓ Backfill status_code ↓ Phase 2 Migrate consumers ↓ Phase 3 Validate ↓ Phase 4 Remove order_status This supports old and new consumers during the transition. Important Do not automatically introduce dual-write. If both fields are maintained independently, they can diverge. If both are temporarily maintained, the source of truth and consistency mechanism must be explicitly defined. --- 12. Validation Test Suite Test ID Area Test Expected Result Failure Condition Status T-01 Schema Verify status_code exists Column exists with expected type Wrong/missing column Required T-02 Schema Verify order_status remains during transition Old consumers still function Column removed prematurely Required T-03 Mapping Compare status mappings Every valid old status has approved mapping Unmapped/ambiguous status Required T-04 Data Compare row counts before/after backfill No unexpected row loss Count mismatch Required T-05 Data Compare status distributions Expected distributions preserved Unexpected distribution change Required T-06 Query Compile migrated SQL Query compiles Compilation failure Required T-07 Query Execute migrated SQL Successful execution Runtime failure Required T-08 KPI Reconcile Completed Orders Approved variance = 0 or documented threshold Unexpected difference Required T-09 Type Test monetary conversion Conversion follows approved rule Precision/data loss Blocking T-10 KPI Reconcile Total Revenue Business-approved result Material unexplained difference Blocking T-11 Pipeline Run daily_orders_transform Successful completion Pipeline failure Required T-12 Historical Compare historical revenue Historical result preserved or explained Unexpected historical change Blocking T-13 BI Open Sales Dashboard Dashboard works Broken visual/query Required T-14 BI Test dashboard filters Filter results remain correct Changed filter behavior Required T-15 Regression Search remaining order_status references No unapproved references remain Undiscovered dependency Blocking --- 13. Cutover Readiness Checklist Area Status Reason Schema readiness ⚠️ Needs Validation New schema is defined but type conversion requires validation Consumer readiness ❌ Blocking Existing consumer uses order_status Pipeline readiness ⚠️ Needs Validation ETL must be migrated and tested Reporting readiness ❌ Blocking Critical KPIs depend on affected fields Data migration readiness ❌ Blocking Monetary conversion rule is not sufficiently defined Monitoring readiness ⚠️ Needs Validation Monitoring details were not supplied Rollback readiness ⚠️ Needs Validation Rollback procedure is not defined in sufficient detail --- 14. Unverified Dependency Register The supplied information does not establish exhaustive lineage. Potentially affected but unverified consumers include: Other SQL queries Additional transformation models Ad-hoc analyst queries Scheduled reports External exports APIs Data science datasets Other BI dashboards Missing evidence A complete dependency inventory/query-history analysis was not supplied. Discovery methods Use available platform metadata, query history, transformation repositories, BI metadata, orchestration definitions, and data catalog/lineage systems. Risk if missed A hidden consumer may continue using: order_status or may depend on the existing precision of: total_amount and fail after cutover. --- 15. Final Migration Decision πŸ”΄ Blocking Schema Changes Removing order_status before all confirmed consumers are migrated. Changing total_amount to NUMBER(10,0) without an approved monetary conversion rule. Cutting over without KPI reconciliation. 🟠 High-Risk Dependencies ANALYTICS.FCT_ORDERS daily_orders_transform Sales Dashboard Completed Orders KPI Total Revenue KPI 🟑 Validation-Required Changes status_code historical backfill Status-value mapping Historical-data reconciliation BI filter behavior Pipeline regression 🟒 Low-Risk / Non-Breaking Adding status_code by itself is generally non-breaking based on the supplied information. βšͺ Unknown Dependencies Unlisted SQL consumers Additional BI objects External consumers Ad-hoc queries Unlisted exports/APIs πŸ“Œ Required Migration Sequence Define status mapping ↓ Add status_code ↓ Backfill status_code ↓ Migrate SQL / ETL consumers ↓ Migrate BI logic ↓ Validate Completed Orders KPI ↓ Define monetary conversion rule ↓ Validate historical revenue ↓ Migrate total_amount ↓ Run full regression ↓ Dependency verification ↓ Cutover ↓ Monitor ↓ Remove order_status after transition Final assessment The proposed schema should not be treated as production-ready in its current form. The primary concerns are not simply the DDL changes themselves, but consumer compatibility, monetary precision, historical-data correctness, and incomplete dependency visibility. The order_status migration can be handled through staged compatibility, while the total_amount change requires an explicit business-approved conversion rule before implementation.
GPT

Data Warehouse Schema Evolution Auditor

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
GPT-5.6
Tested icon
Guide icon
4 examples icon
Free credits icon
Data Warehouse Schema Evolution Auditor analyzes schema versions and dependency information across platforms such as Snowflake, BigQuer 🧬 Compare current vs proposed warehouse schemas 🚨 Detect breaking and potentially breaking changes πŸ”— Trace downstream dataset and query dependencies πŸ§ͺ Identify incompatible data-type changes πŸ” Detect missing migration steps Turn a planned warehouse schema change into a complete impact assessment and controlled migration plan before downstream systems break.
...more
Added over 1 month ago
Report
Browse Marketplace