Skip to content

Preliminary support for window functions#1

Merged
komu merged 1 commit intomainfrom
window-functions
Aug 13, 2025
Merged

Preliminary support for window functions#1
komu merged 1 commit intomainfrom
window-functions

Conversation

@komu
Copy link
Member

@komu komu commented Aug 13, 2025

No description provided.

@komu komu requested a review from Copilot August 13, 2025 10:19
@komu komu force-pushed the window-functions branch from 2bcf218 to 45e3269 Compare August 13, 2025 10:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces preliminary support for window functions in the Kriteria query DSL library. The implementation allows defining window specifications with partition and ordering clauses, and provides common aggregate functions like sum and avg that can operate over these windows.

Key changes:

  • Added KrWindow and KrWindowBuilder classes for defining window specifications with partition and order clauses
  • Extended expression system to support window-based aggregate function calls through CallAggregateExpression
  • Integrated window translation into the JPA translation layer with Hibernate-specific support

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sale.kt New test entity representing sales data with employee, amount, and date fields
WindowFunctionsTest.kt Comprehensive integration test demonstrating window function usage with partitioning and aggregation
KrWindow.kt Core window specification classes with builder pattern for configuration
CommonWindowFunctions.kt Convenience functions for common window aggregates (sum, avg)
KrExpression.kt Enhanced expression hierarchy to support window-based function calls and improved formatting
ExpFunction.kt Added window-specific aggregate function call methods
TranslateWindow.kt Translation logic for converting KrWindow to Hibernate's JpaWindow
TranslationContext.kt Added Hibernate-specific helper for operations requiring HibernateCriteriaBuilder
KrQueryOrSubqueryBuilder.kt Added window() method for creating windows in query builders
TranslateExpression.kt Enhanced expression translation to handle window-based aggregate calls
KrQuery.kt, KrSubquery.kt Extended query structures to include window definitions
TranslateQueries.kt Integrated window translation into query processing
PathCache.kt Added placeholder for window caching (not yet implemented)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@komu komu force-pushed the window-functions branch from 45e3269 to e7fd383 Compare August 13, 2025 10:23
@komu komu merged commit f6dbae5 into main Aug 13, 2025
1 check passed
@komu komu deleted the window-functions branch August 13, 2025 10:26
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.

2 participants