Skip to content

Commit

Permalink
Support time column for first and last aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
Abror Khamrokhujaev authored and galtshifter committed Oct 29, 2024
1 parent 3e4a3fb commit 6be5eaa
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 6 deletions.
8 changes: 7 additions & 1 deletion builder/aggregation/double_first.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type DoubleFirst struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewDoubleFirst() *DoubleFirst {
Expand All @@ -20,3 +21,8 @@ func (d *DoubleFirst) SetFieldName(fieldName string) *DoubleFirst {
d.FieldName = fieldName
return d
}

func (d *DoubleFirst) SetTimeColumn(timeColumn string) *DoubleFirst {
d.TimeColumn = timeColumn
return d
}
8 changes: 7 additions & 1 deletion builder/aggregation/double_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type DoubleLast struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewDoubleLast() *DoubleLast {
Expand All @@ -20,3 +21,8 @@ func (d *DoubleLast) SetFieldName(fieldName string) *DoubleLast {
d.FieldName = fieldName
return d
}

func (l *DoubleLast) SetTimeColumn(timeColumn string) *DoubleLast {
l.TimeColumn = timeColumn
return l
}
8 changes: 7 additions & 1 deletion builder/aggregation/float_first.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type FloatFirst struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewFloatFirst() *FloatFirst {
Expand All @@ -20,3 +21,8 @@ func (f *FloatFirst) SetFieldName(fieldName string) *FloatFirst {
f.FieldName = fieldName
return f
}

func (f *FloatFirst) SetTimeColumn(timeColumn string) *FloatFirst {
f.TimeColumn = timeColumn
return f
}
8 changes: 7 additions & 1 deletion builder/aggregation/float_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type FloatLast struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewFloatLast() *FloatLast {
Expand All @@ -20,3 +21,8 @@ func (f *FloatLast) SetFieldName(fieldName string) *FloatLast {
f.FieldName = fieldName
return f
}

func (f *FloatLast) SetTimeColumn(timeColumn string) *FloatLast {
f.TimeColumn = timeColumn
return f
}
8 changes: 7 additions & 1 deletion builder/aggregation/long_first.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type LongFirst struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewLongFirst() *LongFirst {
Expand All @@ -20,3 +21,8 @@ func (l *LongFirst) SetFieldName(fieldName string) *LongFirst {
l.FieldName = fieldName
return l
}

func (l *LongFirst) SetTimeColumn(timeColumn string) *LongFirst {
l.TimeColumn = timeColumn
return l
}
8 changes: 7 additions & 1 deletion builder/aggregation/long_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package aggregation

type LongLast struct {
Base
FieldName string `json:"fieldName,omitempty"`
FieldName string `json:"fieldName,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewLongLast() *LongLast {
Expand All @@ -20,3 +21,8 @@ func (l *LongLast) SetFieldName(fieldName string) *LongLast {
l.FieldName = fieldName
return l
}

func (l *LongLast) SetTimeColumn(timeColumn string) *LongLast {
l.TimeColumn = timeColumn
return l
}
6 changes: 6 additions & 0 deletions builder/aggregation/string_first.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type StringFirst struct {
Base
FieldName string `json:"fieldName,omitempty"`
MaxStringBytes int64 `json:"maxStringBytes,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewStringFirst() *StringFirst {
Expand All @@ -26,3 +27,8 @@ func (s *StringFirst) SetMaxStringBytes(maxStringBytes int64) *StringFirst {
s.MaxStringBytes = maxStringBytes
return s
}

func (s *StringFirst) SetTimeColumn(timeColumn string) *StringFirst {
s.TimeColumn = timeColumn
return s
}
6 changes: 6 additions & 0 deletions builder/aggregation/string_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type StringLast struct {
Base
FieldName string `json:"fieldName,omitempty"`
MaxStringBytes int64 `json:"maxStringBytes,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
}

func NewStringLast() *StringLast {
Expand All @@ -26,3 +27,8 @@ func (s *StringLast) SetMaxStringBytes(maxStringBytes int64) *StringLast {
s.MaxStringBytes = maxStringBytes
return s
}

func (s *StringLast) SetTimeColumn(timeColumn string) *StringLast {
s.TimeColumn = timeColumn
return s
}

0 comments on commit 6be5eaa

Please sign in to comment.