dataframe

package
v0.0.0-...-77951e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package dataframe provides the DataFrame implementation.

Example (NewDataFrameFromMemory)

This example demonstrates creating a new DataFrame from memory using a Dict and displaying the contents of it.

package main

import (
	"fmt"

	"github.com/apache/arrow/go/arrow/memory"
	"github.com/go-bullseye/bullseye/dataframe"
)

func main() {
	pool := memory.NewGoAllocator()
	df, _ := dataframe.NewDataFrameFromMem(pool, dataframe.Dict{
		"col1": []int32{1, 2, 3, 4, 5},
		"col2": []float64{1.1, 2.2, 3.3, 4.4, 5},
		"col3": []string{"foo", "bar", "ping", "", "pong"},
		"col4": []interface{}{2, 4, 6, nil, 8},
	})
	defer df.Release()
	fmt.Printf("DataFrame:\n%s\n", df.Display(0))

}
Output:

DataFrame:
rec[0]["col1"]: [1 2 3 4 5]
rec[0]["col2"]: [1.1 2.2 3.3 4.4 5]
rec[0]["col3"]: ["foo" "bar" "ping" "" "pong"]
rec[0]["col4"]: [2 4 6 (null) 8]

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColumnFromMem

func NewColumnFromMem(mem memory.Allocator, name string, values interface{}) (*array.Column, error)

NewColumnFromMem is a helper for creating a new Column from memory.

func NewColumnFromSparseMem

func NewColumnFromSparseMem(mem memory.Allocator, name string, values []interface{}, valueIndexes []int, size int) (*array.Column, error)

NewColumnFromSparseMem is a helper for creating a new Column from sparse memory.

Types

type AppenderFunc

type AppenderFunc func(array.Builder, interface{})

AppenderFunc is the function to be used to convert the data to the correct type.

type ApplyToColumnFunc

type ApplyToColumnFunc func(v interface{}) (interface{}, error)

ApplyToColumnFunc is a type alias for a function that will be called for each element that is iterated over in a column. The return value will

type DataFrame

type DataFrame struct {
	// contains filtered or unexported fields
}

DataFrame is an immutable DataFrame that uses Arrow to store it's data in a standard columnar format.

func NewDataFrame

func NewDataFrame(mem memory.Allocator, schema *arrow.Schema, arrs []array.Interface) (*DataFrame, error)

NewDataFrame creates a new data frame from the provided schema and arrays.

func NewDataFrameFromColumns

func NewDataFrameFromColumns(mem memory.Allocator, cols []array.Column) (*DataFrame, error)

NewDataFrameFromColumns returns a DataFrame interface.

func NewDataFrameFromMem

func NewDataFrameFromMem(mem memory.Allocator, dict Dict) (*DataFrame, error)

NewDataFrameFromMem creates a new data frame from the provided in-memory data.

func NewDataFrameFromShape

func NewDataFrameFromShape(mem memory.Allocator, cols []array.Column, rows int64) (*DataFrame, error)

NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number of rows in the DataFrame.

func NewDataFrameFromTable

func NewDataFrameFromTable(mem memory.Allocator, table array.Table) (*DataFrame, error)

func (*DataFrame) Allocator

func (df *DataFrame) Allocator() memory.Allocator

Allocator returns the memory allocator for this DataFrame

func (*DataFrame) AppendColumn

func (df *DataFrame) AppendColumn(c *array.Column) (*DataFrame, error)

AppendColumn builds a new DataFrame with the provided Column included.

func (*DataFrame) Apply

func (df *DataFrame) Apply(fns ...MutationFunc) (*DataFrame, error)

Apply takes a series of MutationFunc and calls them with the existing DataFrame on the left.

func (*DataFrame) ApplyToColumn

func (df *DataFrame) ApplyToColumn(columnName, newColumnName string, fn ApplyToColumnFunc) (*DataFrame, error)

ApplyToColumn creates a new DataFrame with the new column appended. The new column is built with the response values obtained from ApplyToColumnFunc. An error response value from ApplyToColumnFunc will cause ApplyToColumn to return immediately.

func (*DataFrame) Column

func (df *DataFrame) Column(name string) *array.Column

Column returns the column matching the given name.

func (*DataFrame) ColumnAt

func (df *DataFrame) ColumnAt(i int) *array.Column

ColumnAt returns the i-th column of this Frame.

func (*DataFrame) ColumnNames

func (df *DataFrame) ColumnNames() []string

ColumnNames is the slice of column names that make up this DataFrame.

func (*DataFrame) ColumnTypes

func (df *DataFrame) ColumnTypes() []arrow.Field

ColumnTypes is the slice of column types that make up this DataFrame.

func (*DataFrame) Columns

func (df *DataFrame) Columns() []array.Column

Columns is the slice of Columns that make up this DataFrame.

func (*DataFrame) Copy

func (df *DataFrame) Copy() (*DataFrame, error)

Copy returns a copy of this dataframe. The underlying byte buffers will not be copied.

func (*DataFrame) CrossJoin

func (df *DataFrame) CrossJoin(right *DataFrame, opts ...Option) (*DataFrame, error)

CrossJoin returns a DataFrame containing the cross join of two DataFrames.

func (*DataFrame) Dims

func (df *DataFrame) Dims() (int, int64)

Dims retrieves the dimensions of a DataFrame.

func (*DataFrame) Display

func (df *DataFrame) Display(chunkSize int64) string

Display builds out a string representation of the DataFrame that is useful for debugging. if chunkSize is <= 0, the biggest possible chunk will be selected.

func (*DataFrame) Drop

func (df *DataFrame) Drop(names ...string) (*DataFrame, error)

Drop the given DataFrame columns by name.

func (*DataFrame) Equals

func (df *DataFrame) Equals(d *DataFrame) bool

Equals checks for equality between this DataFrame and DataFrame d. nil elements at the same location are considered equal.

func (*DataFrame) InnerJoin

func (df *DataFrame) InnerJoin(right *DataFrame, columns []string, opts ...Option) (*DataFrame, error)

InnerJoin returns a DataFrame containing the inner join of two DataFrames.

func (*DataFrame) LeftJoin

func (df *DataFrame) LeftJoin(right *DataFrame, columns []string, opts ...Option) (*DataFrame, error)

LeftJoin returns a DataFrame containing the left join of two DataFrames.

func (*DataFrame) Name

func (df *DataFrame) Name(i int) string

Name returns the name of the i-th column of this DataFrame.

func (*DataFrame) NumCols

func (df *DataFrame) NumCols() int

NumCols returns the number of columns of this DataFrame using Go's len().

func (*DataFrame) NumRows

func (df *DataFrame) NumRows() int64

NumRows returns the number of rows of this DataFrame.

func (*DataFrame) OuterJoin

func (df *DataFrame) OuterJoin(right *DataFrame, columns []string, opts ...Option) (*DataFrame, error)

OuterJoin returns a DataFrame containing the outer join of two DataFrames. Use union of keys from both frames, similar to a SQL full outer join.

func (*DataFrame) RejectColumns

func (df *DataFrame) RejectColumns(names ...string) []array.Column

RejectColumns returns only columns not matching names.

func (*DataFrame) Release

func (df *DataFrame) Release()

Release decreases the reference count by 1. When the reference count goes to zero, the memory is freed. Release may be called simultaneously from multiple goroutines.

func (*DataFrame) Retain

func (df *DataFrame) Retain()

Retain increases the reference count by 1. Retain may be called simultaneously from multiple goroutines.

func (*DataFrame) RightJoin

func (df *DataFrame) RightJoin(right *DataFrame, columns []string, opts ...Option) (*DataFrame, error)

RightJoin returns a DataFrame containing the right join of two DataFrames.

func (*DataFrame) Schema

func (df *DataFrame) Schema() *arrow.Schema

Schema returns the schema of this Frame.

func (*DataFrame) Select

func (df *DataFrame) Select(names ...string) (*DataFrame, error)

Select the given DataFrame columns by name.

func (*DataFrame) SelectColumns

func (df *DataFrame) SelectColumns(names ...string) []array.Column

SelectColumns returns only columns matching names.

func (*DataFrame) Slice

func (df *DataFrame) Slice(beg, end int64) (*DataFrame, error)

Slice creates a new DataFrame consisting of rows[beg:end].

type Date32Element

type Date32Element struct {
	// contains filtered or unexported fields
}

Date32Element has logic to apply to this type.

func NewDate32Element

func NewDate32Element(v interface{}) *Date32Element

NewDate32Element creates a new Date32Element logic wrapper from the given value provided as v.

func (Date32Element) Copy

func (e Date32Element) Copy() Element

Copy returns a copy of this Date32Element.

func (Date32Element) Eq

func (e Date32Element) Eq(r Element) (bool, error)

Eq returns true if the left Date32Element is equal to the right Date32Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Date32Element) EqStrict

func (e Date32Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Date32Element is equal to the right Date32Element. When both are nil EqStrict returns true.

func (Date32Element) Greater

func (e Date32Element) Greater(r Element) (bool, error)

Greater returns true if the left Date32Element is greter than the right Date32Element.

func (Date32Element) GreaterEq

func (e Date32Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Date32Element is greter than or equal to the right Date32Element.

func (Date32Element) IsNil

func (e Date32Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Date32Element) Less

func (e Date32Element) Less(r Element) (bool, error)

Less returns true if the left Date32Element is less than the right Date32Element.

func (Date32Element) LessEq

func (e Date32Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Date32Element is less than or equal to the right Date32Element.

func (Date32Element) Neq

func (e Date32Element) Neq(r Element) (bool, error)

Neq returns true if the left Date32Element is not equal to the right Date32Element.

func (Date32Element) String

func (e Date32Element) String() string

String prints the value of this element as a string.

type Date64Element

type Date64Element struct {
	// contains filtered or unexported fields
}

Date64Element has logic to apply to this type.

func NewDate64Element

func NewDate64Element(v interface{}) *Date64Element

NewDate64Element creates a new Date64Element logic wrapper from the given value provided as v.

func (Date64Element) Copy

func (e Date64Element) Copy() Element

Copy returns a copy of this Date64Element.

func (Date64Element) Eq

func (e Date64Element) Eq(r Element) (bool, error)

Eq returns true if the left Date64Element is equal to the right Date64Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Date64Element) EqStrict

func (e Date64Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Date64Element is equal to the right Date64Element. When both are nil EqStrict returns true.

func (Date64Element) Greater

func (e Date64Element) Greater(r Element) (bool, error)

Greater returns true if the left Date64Element is greter than the right Date64Element.

func (Date64Element) GreaterEq

func (e Date64Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Date64Element is greter than or equal to the right Date64Element.

func (Date64Element) IsNil

func (e Date64Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Date64Element) Less

func (e Date64Element) Less(r Element) (bool, error)

Less returns true if the left Date64Element is less than the right Date64Element.

func (Date64Element) LessEq

func (e Date64Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Date64Element is less than or equal to the right Date64Element.

func (Date64Element) Neq

func (e Date64Element) Neq(r Element) (bool, error)

Neq returns true if the left Date64Element is not equal to the right Date64Element.

func (Date64Element) String

func (e Date64Element) String() string

String prints the value of this element as a string.

type Dict

type Dict map[string]interface{}

Dict is a map of string to array of data.

type Element

type Element interface {
	// Compare methods
	// Eq returns true if the left Element is equal to the right Element.
	// When both are nil Eq returns false because nil actualy signifies "unknown"
	// and you can't compare two things when you don't know what they are.
	Eq(Element) (bool, error)
	// EqStrict returns true if the left Element is equal to the right Element.
	// When both are nil EqStrict returns true.
	EqStrict(Element) (bool, error)
	// Neq returns true when Eq returns false.
	Neq(Element) (bool, error)
	// Less returns true if the left Element is less than the right Element.
	Less(Element) (bool, error)
	// LessEq returns true if the left Element is less than or equal to the right Element.
	LessEq(Element) (bool, error)
	// Greater returns true if the left Element is greter than the right Element.
	Greater(Element) (bool, error)
	// GreaterEq returns true if the left Element is greter than or equal to the right Element.
	GreaterEq(Element) (bool, error)

	// Copy returns a copy of this Element.
	Copy() Element

	// String prints the value of this element as a string.
	String() string
	// IsNil returns true when the underlying value is nil.
	IsNil() bool
}

Element is an interface for Elements within a Column.

func CastElement

func CastElement(dtype arrow.DataType, v interface{}) Element

CastElement returns an Element type for the passed DataType and value v.

func StepValueElementAt

func StepValueElementAt(stepValue *iterator.StepValue, i int) Element

StepValueElementAt gets the value at i from the StepValue and casts it to an Element.

type Float32Element

type Float32Element struct {
	// contains filtered or unexported fields
}

Float32Element has logic to apply to this type.

func NewFloat32Element

func NewFloat32Element(v interface{}) *Float32Element

NewFloat32Element creates a new Float32Element logic wrapper from the given value provided as v.

func (Float32Element) Copy

func (e Float32Element) Copy() Element

Copy returns a copy of this Float32Element.

func (Float32Element) Eq

func (e Float32Element) Eq(r Element) (bool, error)

Eq returns true if the left Float32Element is equal to the right Float32Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Float32Element) EqStrict

func (e Float32Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Float32Element is equal to the right Float32Element. When both are nil EqStrict returns true.

func (Float32Element) Greater

func (e Float32Element) Greater(r Element) (bool, error)

Greater returns true if the left Float32Element is greter than the right Float32Element.

func (Float32Element) GreaterEq

func (e Float32Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Float32Element is greter than or equal to the right Float32Element.

func (Float32Element) IsNil

func (e Float32Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Float32Element) Less

func (e Float32Element) Less(r Element) (bool, error)

Less returns true if the left Float32Element is less than the right Float32Element.

func (Float32Element) LessEq

func (e Float32Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Float32Element is less than or equal to the right Float32Element.

func (Float32Element) Neq

func (e Float32Element) Neq(r Element) (bool, error)

Neq returns true if the left Float32Element is not equal to the right Float32Element.

func (Float32Element) String

func (e Float32Element) String() string

String prints the value of this element as a string.

type Float64Element

type Float64Element struct {
	// contains filtered or unexported fields
}

Float64Element has logic to apply to this type.

func NewFloat64Element

func NewFloat64Element(v interface{}) *Float64Element

NewFloat64Element creates a new Float64Element logic wrapper from the given value provided as v.

func (Float64Element) Copy

func (e Float64Element) Copy() Element

Copy returns a copy of this Float64Element.

func (Float64Element) Eq

func (e Float64Element) Eq(r Element) (bool, error)

Eq returns true if the left Float64Element is equal to the right Float64Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Float64Element) EqStrict

func (e Float64Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Float64Element is equal to the right Float64Element. When both are nil EqStrict returns true.

func (Float64Element) Greater

func (e Float64Element) Greater(r Element) (bool, error)

Greater returns true if the left Float64Element is greter than the right Float64Element.

func (Float64Element) GreaterEq

func (e Float64Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Float64Element is greter than or equal to the right Float64Element.

func (Float64Element) IsNil

func (e Float64Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Float64Element) Less

func (e Float64Element) Less(r Element) (bool, error)

Less returns true if the left Float64Element is less than the right Float64Element.

func (Float64Element) LessEq

func (e Float64Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Float64Element is less than or equal to the right Float64Element.

func (Float64Element) Neq

func (e Float64Element) Neq(r Element) (bool, error)

Neq returns true if the left Float64Element is not equal to the right Float64Element.

func (Float64Element) String

func (e Float64Element) String() string

String prints the value of this element as a string.

type Int16Element

type Int16Element struct {
	// contains filtered or unexported fields
}

Int16Element has logic to apply to this type.

func NewInt16Element

func NewInt16Element(v interface{}) *Int16Element

NewInt16Element creates a new Int16Element logic wrapper from the given value provided as v.

func (Int16Element) Copy

func (e Int16Element) Copy() Element

Copy returns a copy of this Int16Element.

func (Int16Element) Eq

func (e Int16Element) Eq(r Element) (bool, error)

Eq returns true if the left Int16Element is equal to the right Int16Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Int16Element) EqStrict

func (e Int16Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Int16Element is equal to the right Int16Element. When both are nil EqStrict returns true.

func (Int16Element) Greater

func (e Int16Element) Greater(r Element) (bool, error)

Greater returns true if the left Int16Element is greter than the right Int16Element.

func (Int16Element) GreaterEq

func (e Int16Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Int16Element is greter than or equal to the right Int16Element.

func (Int16Element) IsNil

func (e Int16Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Int16Element) Less

func (e Int16Element) Less(r Element) (bool, error)

Less returns true if the left Int16Element is less than the right Int16Element.

func (Int16Element) LessEq

func (e Int16Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Int16Element is less than or equal to the right Int16Element.

func (Int16Element) Neq

func (e Int16Element) Neq(r Element) (bool, error)

Neq returns true if the left Int16Element is not equal to the right Int16Element.

func (Int16Element) String

func (e Int16Element) String() string

String prints the value of this element as a string.

type Int32Element

type Int32Element struct {
	// contains filtered or unexported fields
}

Int32Element has logic to apply to this type.

func NewInt32Element

func NewInt32Element(v interface{}) *Int32Element

NewInt32Element creates a new Int32Element logic wrapper from the given value provided as v.

func (Int32Element) Copy

func (e Int32Element) Copy() Element

Copy returns a copy of this Int32Element.

func (Int32Element) Eq

func (e Int32Element) Eq(r Element) (bool, error)

Eq returns true if the left Int32Element is equal to the right Int32Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Int32Element) EqStrict

func (e Int32Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Int32Element is equal to the right Int32Element. When both are nil EqStrict returns true.

func (Int32Element) Greater

func (e Int32Element) Greater(r Element) (bool, error)

Greater returns true if the left Int32Element is greter than the right Int32Element.

func (Int32Element) GreaterEq

func (e Int32Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Int32Element is greter than or equal to the right Int32Element.

func (Int32Element) IsNil

func (e Int32Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Int32Element) Less

func (e Int32Element) Less(r Element) (bool, error)

Less returns true if the left Int32Element is less than the right Int32Element.

func (Int32Element) LessEq

func (e Int32Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Int32Element is less than or equal to the right Int32Element.

func (Int32Element) Neq

func (e Int32Element) Neq(r Element) (bool, error)

Neq returns true if the left Int32Element is not equal to the right Int32Element.

func (Int32Element) String

func (e Int32Element) String() string

String prints the value of this element as a string.

type Int64Element

type Int64Element struct {
	// contains filtered or unexported fields
}

Int64Element has logic to apply to this type.

func NewInt64Element

func NewInt64Element(v interface{}) *Int64Element

NewInt64Element creates a new Int64Element logic wrapper from the given value provided as v.

func (Int64Element) Copy

func (e Int64Element) Copy() Element

Copy returns a copy of this Int64Element.

func (Int64Element) Eq

func (e Int64Element) Eq(r Element) (bool, error)

Eq returns true if the left Int64Element is equal to the right Int64Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Int64Element) EqStrict

func (e Int64Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Int64Element is equal to the right Int64Element. When both are nil EqStrict returns true.

func (Int64Element) Greater

func (e Int64Element) Greater(r Element) (bool, error)

Greater returns true if the left Int64Element is greter than the right Int64Element.

func (Int64Element) GreaterEq

func (e Int64Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Int64Element is greter than or equal to the right Int64Element.

func (Int64Element) IsNil

func (e Int64Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Int64Element) Less

func (e Int64Element) Less(r Element) (bool, error)

Less returns true if the left Int64Element is less than the right Int64Element.

func (Int64Element) LessEq

func (e Int64Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Int64Element is less than or equal to the right Int64Element.

func (Int64Element) Neq

func (e Int64Element) Neq(r Element) (bool, error)

Neq returns true if the left Int64Element is not equal to the right Int64Element.

func (Int64Element) String

func (e Int64Element) String() string

String prints the value of this element as a string.

type Int8Element

type Int8Element struct {
	// contains filtered or unexported fields
}

Int8Element has logic to apply to this type.

func NewInt8Element

func NewInt8Element(v interface{}) *Int8Element

NewInt8Element creates a new Int8Element logic wrapper from the given value provided as v.

func (Int8Element) Copy

func (e Int8Element) Copy() Element

Copy returns a copy of this Int8Element.

func (Int8Element) Eq

func (e Int8Element) Eq(r Element) (bool, error)

Eq returns true if the left Int8Element is equal to the right Int8Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Int8Element) EqStrict

func (e Int8Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Int8Element is equal to the right Int8Element. When both are nil EqStrict returns true.

func (Int8Element) Greater

func (e Int8Element) Greater(r Element) (bool, error)

Greater returns true if the left Int8Element is greter than the right Int8Element.

func (Int8Element) GreaterEq

func (e Int8Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Int8Element is greter than or equal to the right Int8Element.

func (Int8Element) IsNil

func (e Int8Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Int8Element) Less

func (e Int8Element) Less(r Element) (bool, error)

Less returns true if the left Int8Element is less than the right Int8Element.

func (Int8Element) LessEq

func (e Int8Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Int8Element is less than or equal to the right Int8Element.

func (Int8Element) Neq

func (e Int8Element) Neq(r Element) (bool, error)

Neq returns true if the left Int8Element is not equal to the right Int8Element.

func (Int8Element) String

func (e Int8Element) String() string

String prints the value of this element as a string.

type MutationFunc

type MutationFunc func(*DataFrame) (*DataFrame, error)

MutationFunc is a function that mutates an existing DataFrame and returns a new DataFrame or an error.

type Mutator

type Mutator struct {
	// contains filtered or unexported fields
}

Mutator is a type that has some standard mutations.

func NewMutator

func NewMutator(mem memory.Allocator) *Mutator

NewMutator creates a new mutator.

func (*Mutator) CrossJoin

func (m *Mutator) CrossJoin(rightDf *DataFrame, opts ...Option) MutationFunc

CrossJoin returns a DataFrame containing the cross join of two DataFrames.

func (*Mutator) Drop

func (m *Mutator) Drop(names ...string) MutationFunc

Drop the given DataFrame columns by name.

func (*Mutator) InnerJoin

func (m *Mutator) InnerJoin(rightDf *DataFrame, columnNames []string, opts ...Option) MutationFunc

InnerJoin returns a DataFrame containing the inner join of two DataFrames. Acts like SQL in that nil elements are treated as unknown so nil != nil.

func (*Mutator) LeftJoin

func (m *Mutator) LeftJoin(rightDf *DataFrame, columnNames []string, opts ...Option) MutationFunc

LeftJoin returns a DataFrame containing the left join of two DataFrames. Acts like SQL in that nil elements are treated as unknown so nil != nil.

func (*Mutator) OuterJoin

func (m *Mutator) OuterJoin(rightDf *DataFrame, columnNames []string, opts ...Option) MutationFunc

OuterJoin returns a DataFrame containing the outer join of two DataFrames. Use union of keys from both frames, similar to a SQL full outer join. Acts like SQL in that nil elements are treated as unknown so nil != nil.

func (*Mutator) RightJoin

func (m *Mutator) RightJoin(rightDf *DataFrame, columnNames []string, opts ...Option) MutationFunc

RightJoin returns a DataFrame containing the right join of two DataFrames. Acts like SQL in that nil elements are treated as unknown so nil != nil.

func (*Mutator) Select

func (m *Mutator) Select(names ...string) MutationFunc

Select the given DataFrame columns by name.

func (*Mutator) Slice

func (m *Mutator) Slice(beg, end int64) MutationFunc

Slice creates a new DataFrame consisting of rows[beg:end].

type Option

type Option func(interface{}) error

Option is an option that may be passed to a function.

func WithLsuffix

func WithLsuffix(lsuffix string) Option

WithLsuffix configures a right or left join to use the provided left suffix.

func WithRsuffix

func WithRsuffix(rsuffix string) Option

WithRsuffix configures a right or left join to use the provided left suffix.

type SmartBuilder

type SmartBuilder struct {
	// contains filtered or unexported fields
}

SmartBuilder knows how to convert to the correct type when building.

func NewSmartBuilder

func NewSmartBuilder(recordBuilder *array.RecordBuilder, schema *arrow.Schema) *SmartBuilder

NewSmartBuilder creates a SmartBuilder that knows how to convert to the correct type when building.

func (*SmartBuilder) Append

func (sb *SmartBuilder) Append(fieldIndex int, v interface{})

Append will append the value to the builder.

type TableFacade

type TableFacade interface {
	array.Table
}

TableFacade is a simple facade for a TableReader.

func NewTableFacade

func NewTableFacade(df *DataFrame) TableFacade

NewTableFacade creates a new TableFacade for a DataFrame.

type Time32Element

type Time32Element struct {
	// contains filtered or unexported fields
}

Time32Element has logic to apply to this type.

func NewTime32Element

func NewTime32Element(v interface{}) *Time32Element

NewTime32Element creates a new Time32Element logic wrapper from the given value provided as v.

func (Time32Element) Copy

func (e Time32Element) Copy() Element

Copy returns a copy of this Time32Element.

func (Time32Element) Eq

func (e Time32Element) Eq(r Element) (bool, error)

Eq returns true if the left Time32Element is equal to the right Time32Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Time32Element) EqStrict

func (e Time32Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Time32Element is equal to the right Time32Element. When both are nil EqStrict returns true.

func (Time32Element) Greater

func (e Time32Element) Greater(r Element) (bool, error)

Greater returns true if the left Time32Element is greter than the right Time32Element.

func (Time32Element) GreaterEq

func (e Time32Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Time32Element is greter than or equal to the right Time32Element.

func (Time32Element) IsNil

func (e Time32Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Time32Element) Less

func (e Time32Element) Less(r Element) (bool, error)

Less returns true if the left Time32Element is less than the right Time32Element.

func (Time32Element) LessEq

func (e Time32Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Time32Element is less than or equal to the right Time32Element.

func (Time32Element) Neq

func (e Time32Element) Neq(r Element) (bool, error)

Neq returns true if the left Time32Element is not equal to the right Time32Element.

func (Time32Element) String

func (e Time32Element) String() string

String prints the value of this element as a string.

type Time64Element

type Time64Element struct {
	// contains filtered or unexported fields
}

Time64Element has logic to apply to this type.

func NewTime64Element

func NewTime64Element(v interface{}) *Time64Element

NewTime64Element creates a new Time64Element logic wrapper from the given value provided as v.

func (Time64Element) Copy

func (e Time64Element) Copy() Element

Copy returns a copy of this Time64Element.

func (Time64Element) Eq

func (e Time64Element) Eq(r Element) (bool, error)

Eq returns true if the left Time64Element is equal to the right Time64Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Time64Element) EqStrict

func (e Time64Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Time64Element is equal to the right Time64Element. When both are nil EqStrict returns true.

func (Time64Element) Greater

func (e Time64Element) Greater(r Element) (bool, error)

Greater returns true if the left Time64Element is greter than the right Time64Element.

func (Time64Element) GreaterEq

func (e Time64Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Time64Element is greter than or equal to the right Time64Element.

func (Time64Element) IsNil

func (e Time64Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Time64Element) Less

func (e Time64Element) Less(r Element) (bool, error)

Less returns true if the left Time64Element is less than the right Time64Element.

func (Time64Element) LessEq

func (e Time64Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Time64Element is less than or equal to the right Time64Element.

func (Time64Element) Neq

func (e Time64Element) Neq(r Element) (bool, error)

Neq returns true if the left Time64Element is not equal to the right Time64Element.

func (Time64Element) String

func (e Time64Element) String() string

String prints the value of this element as a string.

type TimestampElement

type TimestampElement struct {
	// contains filtered or unexported fields
}

TimestampElement has logic to apply to this type.

func NewTimestampElement

func NewTimestampElement(v interface{}) *TimestampElement

NewTimestampElement creates a new TimestampElement logic wrapper from the given value provided as v.

func (TimestampElement) Copy

func (e TimestampElement) Copy() Element

Copy returns a copy of this TimestampElement.

func (TimestampElement) Eq

func (e TimestampElement) Eq(r Element) (bool, error)

Eq returns true if the left TimestampElement is equal to the right TimestampElement. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (TimestampElement) EqStrict

func (e TimestampElement) EqStrict(r Element) (bool, error)

EqStrict returns true if the left TimestampElement is equal to the right TimestampElement. When both are nil EqStrict returns true.

func (TimestampElement) Greater

func (e TimestampElement) Greater(r Element) (bool, error)

Greater returns true if the left TimestampElement is greter than the right TimestampElement.

func (TimestampElement) GreaterEq

func (e TimestampElement) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left TimestampElement is greter than or equal to the right TimestampElement.

func (TimestampElement) IsNil

func (e TimestampElement) IsNil() bool

IsNil returns true when the underlying value is nil.

func (TimestampElement) Less

func (e TimestampElement) Less(r Element) (bool, error)

Less returns true if the left TimestampElement is less than the right TimestampElement.

func (TimestampElement) LessEq

func (e TimestampElement) LessEq(r Element) (bool, error)

LessEq returns true if the left TimestampElement is less than or equal to the right TimestampElement.

func (TimestampElement) Neq

func (e TimestampElement) Neq(r Element) (bool, error)

Neq returns true if the left TimestampElement is not equal to the right TimestampElement.

func (TimestampElement) String

func (e TimestampElement) String() string

String prints the value of this element as a string.

type Uint16Element

type Uint16Element struct {
	// contains filtered or unexported fields
}

Uint16Element has logic to apply to this type.

func NewUint16Element

func NewUint16Element(v interface{}) *Uint16Element

NewUint16Element creates a new Uint16Element logic wrapper from the given value provided as v.

func (Uint16Element) Copy

func (e Uint16Element) Copy() Element

Copy returns a copy of this Uint16Element.

func (Uint16Element) Eq

func (e Uint16Element) Eq(r Element) (bool, error)

Eq returns true if the left Uint16Element is equal to the right Uint16Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Uint16Element) EqStrict

func (e Uint16Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Uint16Element is equal to the right Uint16Element. When both are nil EqStrict returns true.

func (Uint16Element) Greater

func (e Uint16Element) Greater(r Element) (bool, error)

Greater returns true if the left Uint16Element is greter than the right Uint16Element.

func (Uint16Element) GreaterEq

func (e Uint16Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Uint16Element is greter than or equal to the right Uint16Element.

func (Uint16Element) IsNil

func (e Uint16Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Uint16Element) Less

func (e Uint16Element) Less(r Element) (bool, error)

Less returns true if the left Uint16Element is less than the right Uint16Element.

func (Uint16Element) LessEq

func (e Uint16Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Uint16Element is less than or equal to the right Uint16Element.

func (Uint16Element) Neq

func (e Uint16Element) Neq(r Element) (bool, error)

Neq returns true if the left Uint16Element is not equal to the right Uint16Element.

func (Uint16Element) String

func (e Uint16Element) String() string

String prints the value of this element as a string.

type Uint32Element

type Uint32Element struct {
	// contains filtered or unexported fields
}

Uint32Element has logic to apply to this type.

func NewUint32Element

func NewUint32Element(v interface{}) *Uint32Element

NewUint32Element creates a new Uint32Element logic wrapper from the given value provided as v.

func (Uint32Element) Copy

func (e Uint32Element) Copy() Element

Copy returns a copy of this Uint32Element.

func (Uint32Element) Eq

func (e Uint32Element) Eq(r Element) (bool, error)

Eq returns true if the left Uint32Element is equal to the right Uint32Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Uint32Element) EqStrict

func (e Uint32Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Uint32Element is equal to the right Uint32Element. When both are nil EqStrict returns true.

func (Uint32Element) Greater

func (e Uint32Element) Greater(r Element) (bool, error)

Greater returns true if the left Uint32Element is greter than the right Uint32Element.

func (Uint32Element) GreaterEq

func (e Uint32Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Uint32Element is greter than or equal to the right Uint32Element.

func (Uint32Element) IsNil

func (e Uint32Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Uint32Element) Less

func (e Uint32Element) Less(r Element) (bool, error)

Less returns true if the left Uint32Element is less than the right Uint32Element.

func (Uint32Element) LessEq

func (e Uint32Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Uint32Element is less than or equal to the right Uint32Element.

func (Uint32Element) Neq

func (e Uint32Element) Neq(r Element) (bool, error)

Neq returns true if the left Uint32Element is not equal to the right Uint32Element.

func (Uint32Element) String

func (e Uint32Element) String() string

String prints the value of this element as a string.

type Uint64Element

type Uint64Element struct {
	// contains filtered or unexported fields
}

Uint64Element has logic to apply to this type.

func NewUint64Element

func NewUint64Element(v interface{}) *Uint64Element

NewUint64Element creates a new Uint64Element logic wrapper from the given value provided as v.

func (Uint64Element) Copy

func (e Uint64Element) Copy() Element

Copy returns a copy of this Uint64Element.

func (Uint64Element) Eq

func (e Uint64Element) Eq(r Element) (bool, error)

Eq returns true if the left Uint64Element is equal to the right Uint64Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Uint64Element) EqStrict

func (e Uint64Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Uint64Element is equal to the right Uint64Element. When both are nil EqStrict returns true.

func (Uint64Element) Greater

func (e Uint64Element) Greater(r Element) (bool, error)

Greater returns true if the left Uint64Element is greter than the right Uint64Element.

func (Uint64Element) GreaterEq

func (e Uint64Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Uint64Element is greter than or equal to the right Uint64Element.

func (Uint64Element) IsNil

func (e Uint64Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Uint64Element) Less

func (e Uint64Element) Less(r Element) (bool, error)

Less returns true if the left Uint64Element is less than the right Uint64Element.

func (Uint64Element) LessEq

func (e Uint64Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Uint64Element is less than or equal to the right Uint64Element.

func (Uint64Element) Neq

func (e Uint64Element) Neq(r Element) (bool, error)

Neq returns true if the left Uint64Element is not equal to the right Uint64Element.

func (Uint64Element) String

func (e Uint64Element) String() string

String prints the value of this element as a string.

type Uint8Element

type Uint8Element struct {
	// contains filtered or unexported fields
}

Uint8Element has logic to apply to this type.

func NewUint8Element

func NewUint8Element(v interface{}) *Uint8Element

NewUint8Element creates a new Uint8Element logic wrapper from the given value provided as v.

func (Uint8Element) Copy

func (e Uint8Element) Copy() Element

Copy returns a copy of this Uint8Element.

func (Uint8Element) Eq

func (e Uint8Element) Eq(r Element) (bool, error)

Eq returns true if the left Uint8Element is equal to the right Uint8Element. When both are nil Eq returns false because nil actualy signifies "unknown" and you can't compare two things when you don't know what they are.

func (Uint8Element) EqStrict

func (e Uint8Element) EqStrict(r Element) (bool, error)

EqStrict returns true if the left Uint8Element is equal to the right Uint8Element. When both are nil EqStrict returns true.

func (Uint8Element) Greater

func (e Uint8Element) Greater(r Element) (bool, error)

Greater returns true if the left Uint8Element is greter than the right Uint8Element.

func (Uint8Element) GreaterEq

func (e Uint8Element) GreaterEq(r Element) (bool, error)

GreaterEq returns true if the left Uint8Element is greter than or equal to the right Uint8Element.

func (Uint8Element) IsNil

func (e Uint8Element) IsNil() bool

IsNil returns true when the underlying value is nil.

func (Uint8Element) Less

func (e Uint8Element) Less(r Element) (bool, error)

Less returns true if the left Uint8Element is less than the right Uint8Element.

func (Uint8Element) LessEq

func (e Uint8Element) LessEq(r Element) (bool, error)

LessEq returns true if the left Uint8Element is less than or equal to the right Uint8Element.

func (Uint8Element) Neq

func (e Uint8Element) Neq(r Element) (bool, error)

Neq returns true if the left Uint8Element is not equal to the right Uint8Element.

func (Uint8Element) String

func (e Uint8Element) String() string

String prints the value of this element as a string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL