Noshitha Padma Pratyusha Juttu

SnowConvert AI — Software Engineering Take-Home
Submitted: April 19, 2026
Environment: TAKEHOME_FINANCE / PLANNING schema
Warehouse: TAKEHOME_WH
Procedures completed: 3 of 6
I treated this migration as a correctness problem, not a syntax problem. SnowConvert AI accelerated discovery and initial scaffolding; manual refactoring preserved business intent where SQL Server-specific constructs had no direct Snowflake equivalent; and a four-layer validation framework distinguished compile success from actual behavioral correctness.
3
Procedures migrated & validated
769
Lines of Snowflake-native SQL written
12
SQL Server constructs manually refactored
4
Validation layers per procedure
Planning.usp_ProcessBudgetConsolidation
Hierarchy rollup consolidation across cost centers, GL accounts, and fiscal periods
✓ SUCCESS
SQL Server constructs requiring manual refactoring
CURSOR (FAST_FORWARD) Table variables w/ indexes CROSS APPLY + TVF OUTPUT INTO MERGE w/ OUTPUT clause XML parameter parsing SCOPE_IDENTITY() @@TRANCOUNT nesting TRY-CATCH / RAISERROR Dynamic SQL sp_executesql Named SAVEPOINTs SET XACT_ABORT
Snowflake approach

Replaced cursor-driven cost center traversal with a recursive CTE hierarchy expansion. XML parameter parsing replaced with VARIANT + TRY_TO_NUMBER / TRY_TO_BOOLEAN. OUTPUT INTO replaced with RESULT_SCAN(LAST_QUERY_ID()). Exception handling via Snowflake EXCEPTION WHEN blocks. Transaction semantics simplified to Snowflake's single-level model.

Validation outcome

Procedure executed successfully in 6.0s. Created a new consolidated budget header, inserted 51 consolidated line items, verified rollup of leaf-level amounts into parent and root cost centers at the (CostCenterID, GLAccountID, FiscalPeriodID) grain. No duplicate rows, all referential integrity checks passed.

target_budget_header_id: created rows_processed: 51 status: SUCCESS hierarchy rollup: verified referential integrity: passed
Planning.usp_ReconcileIntercompanyBalances
Intercompany pair matching with tolerance-based reconciliation and variance reporting
✓ SUCCESS
SQL Server constructs requiring manual refactoring
Table-valued parameters Locking primitives (UPDLOCK) Cursor-driven pair matching TRY-CATCH / THROW OUTPUT clause on UPDATE @@ROWCOUNT checks
Snowflake approach

Table-valued parameters replaced with temp tables (T_ENTITYLIST, T_INTERCOMPANY_PAIRS) seeded at procedure start. Locking hints removed — Snowflake's MVCC model handles isolation. Pair matching redesigned as a set-based CTE instead of cursor-driven row-by-row logic. Variance aggregation via window functions.

Validation outcome

Procedure executed successfully in 5.0s on a controlled +100,000 / -100,000 offsetting test case. Identified 2 intercompany pairs, marked both reconciled, produced zero unreconciled balances and zero total variance. Reconciliation report returned as VARIANT with full pair-level detail.

TotalPairs: 2 Reconciled: 2 Unreconciled: 0 TotalVariance: 0 status: SUCCESS
Planning.usp_ExecuteCostAllocation
Rule-based cost allocation with dry-run mode, dependency sequencing, and AllocationSourceLineID lineage
✓ SUCCESS
SQL Server constructs requiring manual refactoring
WHILE loop w/ cursor Table-valued parameters OUTPUT INTO for lineage WAITFOR DELAY throttle sp_getapplock concurrency TRY-CATCH / THROW
Snowflake approach

Cursor-based rule iteration replaced with set-based execution using T_RULES and T_SOURCE_LINES temp tables, sorted by ExecutionSequence. WAITFOR DELAY / sp_getapplock dropped — no equivalent needed in Snowflake's serverless model. Dry-run mode preserved via p_dry_run flag gating the final INSERT. AllocationSourceLineID lineage preserved through explicit column mapping.

Validation outcome

Procedure executed in 6.2s. Allocated 14 rows with dry_run=false. Source rows correctly marked as allocated. Generated rows reference valid source lines through AllocationSourceLineID. Referential integrity verified across GL accounts, cost centers, and fiscal periods. No duplicate allocated rows at expected business grain.

rows_allocated: 14 dry_run: false source rows marked: ✓ lineage preserved: ✓ status: SUCCESS

The same four-layer framework was applied to all three procedures, making it repeatable across different business logic domains.

01
Pre-run Readiness
  • Source budget header exists and is in eligible status
  • Required reference data seeded (GL accounts, cost centers, fiscal periods)
  • Procedure-specific preconditions met (e.g. intercompany flags, allocation rules active)
02
Execution Check
  • Procedure completes without runtime error
  • Returns SUCCESS status in VARIANT output
  • Key metadata fields populated (IDs, row counts, report objects)
03
Post-run Business Validation
  • Output row counts match expected business logic (e.g. rollup factor, pair count)
  • Business-level outcomes correct (consolidation amounts, zero variance, allocated rows)
  • Source state mutations applied correctly (status updates, IsAllocated flags)
04
Structural Data Quality
  • Referential integrity across all FK relationships
  • Required output columns fully populated (no NULLs in NOT NULL fields)
  • No duplicate rows at expected business grain
  • Regression-safe: framework reusable with different parameters
AI Tool Where it was useful Where manual work was required
SnowConvert AI Object scaffolding, dependency graph, initial syntax translation patterns, surfacing likely incompatibilities quickly Complex procedures with cursors, TVPs, XML parsing, and OUTPUT INTO required full manual redesign — SnowConvert output was not executable as-is for these
Cortex (Snowflake) Initial exploration of procedural rewrite options, quick lookup of Snowflake SQL equivalents Tended to drift from actual business logic when followed literally for complex multi-step procedures. Used for exploration only, not final logic design
AI (general) Drafting parts of validation documentation structure; speeding up investigation of Snowflake-specific function equivalents All validation criteria, migration assumptions, business logic interpretation, debugging, and test data design were manual
Summary: AI was most effective as an accelerator for discovery and initial translation, and weakest for end-to-end correctness in procedures involving hierarchy rollups, pair-matching reconciliation logic, or allocation dependency sequencing. For those cases, correctness required manual reasoning about intent, not prompt refinement.
3 procedures migrated, validated, and production-ready on Snowflake
Consolidation · Intercompany Reconciliation · Cost Allocation — covering three distinct financial planning workflows
usp_ProcessBudgetConsolidation usp_ReconcileIntercompanyBalances usp_ExecuteCostAllocation