Browse Source
feat: Add DATE_TRUNC function with comprehensive tests
feat: Add DATE_TRUNC function with comprehensive tests
- Implement comprehensive DATE_TRUNC function supporting:
- Time precisions: microsecond, millisecond, second, minute, hour
- Date precisions: day, week, month, quarter, year, decade, century, millennium
- Support both singular and plural forms (e.g., 'minute' and 'minutes')
- Enhanced date/time parsing with proper timezone handling:
- Assume local timezone for non-timezone string formats
- Support UTC formats with explicit timezone indicators
- Consistent behavior between parsing and truncation
- Comprehensive test suite with 11 test cases covering:
- All supported precisions from microsecond to year
- Multiple input types (TimestampValue, string dates)
- Edge cases (null values, invalid precisions)
- Timezone consistency validation
All tests passing ✅
pull/7185/head
2 changed files with 259 additions and 8 deletions
Write
Preview
Loading…
Cancel
Save
Reference in new issue