Skip to content

feat:Implement single column aggregations, Implement group by statments, implement having statments#23

Merged
Rich-T-kid merged 5 commits intopre-releasefrom
feature/Basic-Aggr-expr
Nov 26, 2025
Merged

feat:Implement single column aggregations, Implement group by statments, implement having statments#23
Rich-T-kid merged 5 commits intopre-releasefrom
feature/Basic-Aggr-expr

Conversation

@Rich-T-kid
Copy link
Copy Markdown
Owner

single column aggregations are implemented and tested, Next step is to include group by statments (having is already implented due to how flexible out expression interface is)

Copy link
Copy Markdown
Contributor

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 implements single-column aggregation operations (MIN, MAX, COUNT, SUM, AVG) without GROUP BY support, consolidating previous stub implementations into a unified singleAggr.go file with comprehensive test coverage.

Key Changes

  • Implemented accumulator-based aggregation pattern with 5 aggregate functions (MIN, MAX, COUNT, SUM, AVG)
  • Created AggrExec operator that acts as a pipeline breaker, consuming all input batches and returning a single result row
  • Added comprehensive test suite covering all aggregate functions, type validation, and error cases

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
singleAggr.go New unified aggregation implementation with accumulator pattern and AggrExec operator
singleAggr_test.go Comprehensive test suite for all aggregate functions and edge cases
sum.go, sum_test.go Removed - consolidated into singleAggr.go
basicAggr.go, basicAggr_test.go Removed - consolidated into singleAggr.go
avgExec.go, avgExec_test.go Removed - consolidated into singleAggr.go
expr.go Removed unnecessary comment from cast error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. 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.

Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. 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.

Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/groupBy.go
Comment thread src/Backend/opti-sql-go/operators/aggr/groupBy_test.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/sort.go Outdated
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 21 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. 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.

Comment thread src/Backend/opti-sql-go/operators/aggr/groupBy.go Outdated
Comment thread src/Backend/opti-sql-go/operators/test/t1_test.go
Comment thread src/Backend/opti-sql-go/Expr/expr.go
Comment thread src/Backend/opti-sql-go/operators/aggr/groupBy.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/having.go
Comment thread src/Backend/opti-sql-go/operators/aggr/having.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr.go Outdated
Comment thread src/Backend/opti-sql-go/operators/aggr/groupBy.go
Comment thread src/Backend/opti-sql-go/operators/aggr/singleAggr_test.go
@Rich-T-kid
Copy link
Copy Markdown
Owner Author

introduce this embedding to all operators to reduce code duplications. seems like anice use case for golang

    child  operators.Operator
    schema *arrow.Schema
    done   bool
}

@Rich-T-kid Rich-T-kid changed the title feat:Implement single column aggregations, no support for group by yet feat:Implement single column aggregations, Implement group by statments, implement having statments Nov 26, 2025
@Rich-T-kid Rich-T-kid merged commit 3e20453 into pre-release Nov 26, 2025
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