| 123456789101112131415161718192021222324252627282930 |
- package core
- import "TsDB2/DB/core/types"
- type GeCondition struct {
- Field string
- Value interface{}
- Type types.FieldType
- }
- func Ge(field string, value interface{}, typ types.FieldType) Condition {
- return GeCondition{Field: field, Value: value, Type: typ}
- }
- func (c GeCondition) Fields() []string {
- return []string{c.Field}
- }
- func (c GeCondition) Match(row []byte, table *Table) bool {
- fieldIdx := table.findFieldIndex(c.Field)
- if fieldIdx < 0 {
- return false
- }
- offset, ok := table.getVersionedOffset(row, fieldIdx)
- if !ok {
- return false
- }
- return table.compareGreaterOrEqual(row, offset, c.Type, c.Value)
- }
|