Skip to content

feat(analysis): add DateTruncator for cross-DB date truncation#112

Merged
cct08311github merged 2 commits intodotnet8from
issue-98-date-truncator
Mar 9, 2026
Merged

feat(analysis): add DateTruncator for cross-DB date truncation#112
cct08311github merged 2 commits intodotnet8from
issue-98-date-truncator

Conversation

@cct08311github
Copy link
Copy Markdown
Owner

Summary

  • Add DateTruncator static class with BuildTruncExpression and FormatKey methods for cross-DB safe date truncation using DateTime.Year/.Month/.Day CLR properties (MSSQL + Oracle safe)
  • Supports Year, Quarter, Month, Day hierarchies with integer key encoding (e.g. 20260309 for Day)
  • Handles both DateTime and DateTime? input expressions
  • Fix pre-existing AnalysisQueryEngine duplicate constructor conflict from merged refactor(analysis): extract GroupBy strategy pattern #108 + feat(analysis): add QueryHash cache layer with IAnalysisCache #109, and remove dead ExecuteGroupBy/BuildGroupKey methods already extracted to InProcessGroupByStrategy

Closes #98

Test plan

  • 15 new MSTest cases covering all hierarchies, nullable DateTime, FormatKey, and invalid input
  • dotnet build WalkingTec.Mvvm.sln -c Release -- 0 errors
  • dotnet test --filter "FullyQualifiedName~Analysis" -- 107 tests pass

🤖 Generated with Claude Code

…#98)

Add DateTruncator static class that builds Expression Trees using
DateTime.Year/.Month/.Day CLR properties for cross-DB safe date
truncation in GroupBy operations. Supports Year, Quarter, Month, Day
hierarchies with integer key encoding and human-readable formatting.

Also fix pre-existing AnalysisQueryEngine duplicate constructor conflict
(from merged #108 + #109) and remove dead ExecuteGroupBy/BuildGroupKey
methods already extracted to InProcessGroupByStrategy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cct08311github cct08311github merged commit 491cad2 into dotnet8 Mar 9, 2026
3 checks passed
@cct08311github cct08311github deleted the issue-98-date-truncator branch March 20, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase2-2.1] DateTruncator 跨 DB 日期截斷 Expression Tree

1 participant