github.com/tobgu/qframe@v0.4.0/internal/column/column.go (about)

     1  package column
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/tobgu/qframe/config/rolling"
     6  
     7  	"github.com/tobgu/qframe/internal/index"
     8  	"github.com/tobgu/qframe/types"
     9  )
    10  
    11  type Column interface {
    12  	fmt.Stringer
    13  	Filter(index index.Int, comparator interface{}, comparatee interface{}, bIndex index.Bool) error
    14  	Subset(index index.Int) Column
    15  	Append(cols ...Column) (Column, error)
    16  	Equals(index index.Int, other Column, otherIndex index.Int) bool
    17  	Comparable(reverse, equalNull, nullLast bool) Comparable
    18  	Aggregate(indices []index.Int, fn interface{}) (Column, error)
    19  	StringAt(i uint32, naRep string) string
    20  	AppendByteStringAt(buf []byte, i uint32) []byte
    21  	ByteSize() int
    22  	Len() int
    23  
    24  	Apply1(fn interface{}, ix index.Int) (interface{}, error)
    25  	Apply2(fn interface{}, s2 Column, ix index.Int) (Column, error)
    26  
    27  	Rolling(fn interface{}, ix index.Int, config rolling.Config) (Column, error)
    28  
    29  	FunctionType() types.FunctionType
    30  	DataType() types.DataType
    31  }
    32  
    33  type CompareResult byte
    34  
    35  const (
    36  	LessThan CompareResult = iota
    37  	GreaterThan
    38  	Equal
    39  
    40  	// Used when comparing null with null
    41  	NotEqual
    42  )
    43  
    44  type Comparable interface {
    45  	Compare(i, j uint32) CompareResult
    46  	Hash(i uint32, seed uint64) uint64
    47  }