Default LastUpdated/LoadDate on EmployeeAccrualBalances#315
Default LastUpdated/LoadDate on EmployeeAccrualBalances#315rmartinsen-ucd wants to merge 1 commit into
Conversation
The ADF RefreshEmployeeAccrualBalances upsert auto-maps columns by name, and the source sproc usp_GetEmployeeAccrualBalances does not return LastUpdated or LoadDate. With LastUpdated NOT NULL and no default, the sink INSERT failed with "Cannot insert the value NULL into column 'LastUpdated'". Add DEFAULT SYSUTCDATETIME() so the DB stamps the load time when ADF omits the columns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesDefault UTC Timestamp Constraints
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The
RefreshEmployeeAccrualBalancesADF pipeline failed on the SQL sink with:The Copy activity uses ADF's auto-mapping (no explicit column list in the
TabularTranslator), and the source sprocusp_GetEmployeeAccrualBalancesdoesn't returnLastUpdatedorLoadDate. So the upsert MERGE omits those columns.LastUpdatedisNOT NULLwith no default, so the insert blew up.Fix
Add
DEFAULT SYSUTCDATETIME()to bothLastUpdatedandLoadDateso the DB stamps the load time when ADF omits the columns.LastUpdatedstaysNOT NULL.A trigger was considered but rejected: the
NOT NULLcheck fires before anAFTER INSERTtrigger, so it wouldn't help without anINSTEAD OFtrigger — heavier and more surprising than a default.Deploy note
For the existing table, the constraints can be applied directly:
🤖 Generated with Claude Code
Summary by CodeRabbit