Skip to content

Commit

Permalink
Delete unused ctx
Browse files Browse the repository at this point in the history
Signed-off-by: SungJin1212 <[email protected]>
  • Loading branch information
SungJin1212 committed Jan 9, 2025
1 parent 1dfcdc1 commit b33dea0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions execution/aggregate/hashaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type aggregate struct {
}

func NewHashAggregate(
ctx context.Context,
points *model.VectorPool,
next model.VectorOperator,
paramOp model.VectorOperator,
Expand All @@ -56,7 +55,7 @@ func NewHashAggregate(
opts *query.Options,
) (model.VectorOperator, error) {
// Verify that the aggregation is supported.
if _, err := newScalarAccumulator(ctx, aggregation); err != nil {
if _, err := newScalarAccumulator(aggregation); err != nil {
return nil, err
}

Expand Down Expand Up @@ -267,7 +266,7 @@ func (a *aggregate) initializeScalarTables(ctx context.Context) ([]aggregateTabl

inputCache[i] = output.ID
}
tables, err := newScalarTables(ctx, a.stepsBatch, inputCache, outputCache, a.aggregation)
tables, err := newScalarTables(a.stepsBatch, inputCache, outputCache, a.aggregation)
if err != nil {
return nil, nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions execution/aggregate/scalar_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ type scalarTable struct {
accumulators []accumulator
}

func newScalarTables(ctx context.Context, stepsBatch int, inputCache []uint64, outputCache []*model.Series, aggregation parser.ItemType) ([]aggregateTable, error) {
func newScalarTables(stepsBatch int, inputCache []uint64, outputCache []*model.Series, aggregation parser.ItemType) ([]aggregateTable, error) {
tables := make([]aggregateTable, stepsBatch)
for i := 0; i < len(tables); i++ {
table, err := newScalarTable(ctx, inputCache, outputCache, aggregation)
table, err := newScalarTable(inputCache, outputCache, aggregation)
if err != nil {
return nil, err
}
Expand All @@ -60,10 +60,10 @@ func (t *scalarTable) timestamp() int64 {
return t.ts
}

func newScalarTable(ctx context.Context, inputSampleIDs []uint64, outputs []*model.Series, aggregation parser.ItemType) (*scalarTable, error) {
func newScalarTable(inputSampleIDs []uint64, outputs []*model.Series, aggregation parser.ItemType) (*scalarTable, error) {
accumulators := make([]accumulator, len(outputs))
for i := 0; i < len(accumulators); i++ {
acc, err := newScalarAccumulator(ctx, aggregation)
acc, err := newScalarAccumulator(aggregation)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func hashMetric(
return key, builder.Labels()
}

func newScalarAccumulator(ctx context.Context, expr parser.ItemType) (accumulator, error) {
func newScalarAccumulator(expr parser.ItemType) (accumulator, error) {
t := parser.ItemTypeStr[expr]
switch t {
case "sum":
Expand Down
2 changes: 1 addition & 1 deletion execution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func newAggregateExpression(ctx context.Context, e *logicalplan.Aggregation, sca
if e.Op == parser.TOPK || e.Op == parser.BOTTOMK {
next, err = aggregate.NewKHashAggregate(model.NewVectorPool(opts.StepsBatch), next, paramOp, e.Op, !e.Without, e.Grouping, opts)
} else {
next, err = aggregate.NewHashAggregate(ctx, model.NewVectorPool(opts.StepsBatch), next, paramOp, e.Op, !e.Without, e.Grouping, opts)
next, err = aggregate.NewHashAggregate(model.NewVectorPool(opts.StepsBatch), next, paramOp, e.Op, !e.Without, e.Grouping, opts)
}
if err != nil {
return nil, err
Expand Down

0 comments on commit b33dea0

Please sign in to comment.