package core import "TsDB2/DB/core/types" type GtCondition struct { Field string Value interface{} Type types.FieldType } func Gt(field string, value interface{}, typ types.FieldType) Condition { return GtCondition{Field: field, Value: value, Type: typ} } func (c GtCondition) Fields() []string { return []string{c.Field} } func (c GtCondition) 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.compareGreater(row, offset, c.Type, c.Value) }