Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
trzysiek committed Dec 27, 2024
1 parent e52f4c6 commit 286a35d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions quesma/model/bucket_aggregations/ip_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (interval IpInterval) ToWhereClause(field model.Expr) model.Expr {
isBegin := interval.begin != UnboundedInterval
isEnd := interval.end != UnboundedInterval && interval.end != BiggestIpv4

begin := model.TrueExpr //model.NewInfixExpr(field, ">=", model.NewLiteralSingleQuoted(interval.begin))
end := model.TrueExpr //model.NewInfixExpr(field, "<", model.NewLiteralSingleQuoted(interval.end))
begin := model.NewInfixExpr(field, ">=", model.NewLiteralSingleQuoted(interval.begin))
end := model.NewInfixExpr(field, "<", model.NewLiteralSingleQuoted(interval.end))

if isBegin && isEnd {
return model.NewInfixExpr(begin, "AND", end)
Expand All @@ -125,7 +125,6 @@ func (query *IpRange) AggregationType() model.AggregationType {
}

func (query *IpRange) TranslateSqlResponseToJson(rows []model.QueryResultRow) model.JsonMap {
fmt.Println("DUPA", rows)
return nil
}

Expand Down Expand Up @@ -156,7 +155,6 @@ func (query *IpRange) CombinatorGroups() (result []CombinatorGroup) {
// bad requests: both to/from and mask

func (query *IpRange) CombinatorTranslateSqlResponseToJson(subGroup CombinatorGroup, rows []model.QueryResultRow) model.JsonMap {
fmt.Println("SB", subGroup, "ROWS", rows)
if len(rows) == 0 || len(rows[0].Cols) == 0 {
logger.ErrorWithCtx(query.ctx).Msgf("need at least one row and column in ip_range aggregation response, rows: %d, cols: %d", len(rows), len(rows[0].Cols))
return model.JsonMap{}
Expand Down

0 comments on commit 286a35d

Please sign in to comment.