Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterObjectStore(scheme string, store ObjectStore) error
- func WriteArrow(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteCSV(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteIPCFile(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteIPCStream(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteJSON(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteNDJSON(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteParquet(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
- func WriteParquetDataset(ctx context.Context, df *DataFrame, destination string, ...) error
- type AsOfJoinOption
- func WithAsOfAllowExact(enabled bool) AsOfJoinOption
- func WithAsOfCheckSortedness(enabled bool) AsOfJoinOption
- func WithAsOfStrategy(strategy AsOfStrategy) AsOfJoinOption
- func WithAsofAllowExact(enabled bool) AsOfJoinOption
- func WithAsofCheckSortedness(enabled bool) AsOfJoinOption
- func WithAsofStrategy(strategy AsofStrategy) AsOfJoinOption
- type AsOfStrategy
- type AsofStrategy
- type ColumnNotFoundError
- type DataFrame
- func DataFrameFromArrow(table arrow.Table) (*DataFrame, error)
- func DataFrameFromMaps(rows []map[string]any) (*DataFrame, error)
- func DataFrameFromRecordBatch(batch arrow.RecordBatch) (*DataFrame, error)
- func DataFrameFromRecordBatches(batches []arrow.RecordBatch) (*DataFrame, error)
- func DataFrameFromStructs[T any](rows []T) (*DataFrame, error)
- func NewDataFrame(columns ...*Series) (*DataFrame, error)
- func NewDataFrameFromArrow(table arrow.Table) (*DataFrame, error)
- func NewDataFrameFromMaps(rows []map[string]any) (*DataFrame, error)
- func NewDataFrameFromRecordBatch(batch arrow.RecordBatch) (*DataFrame, error)
- func NewDataFrameFromRecordBatches(batches []arrow.RecordBatch) (*DataFrame, error)
- func NewDataFrameFromStructs[T any](rows []T) (*DataFrame, error)
- func ReadArrow(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func ReadCSV(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func ReadCSVReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
- func ReadIPCFile(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func ReadIPCStreamReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
- func ReadJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func ReadJSONReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
- func ReadNDJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func ReadNDJSONReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
- func ReadParquet(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (df *DataFrame) ArrowTable() (arrow.Table, error)
- func (df *DataFrame) Clear() (*DataFrame, error)
- func (df *DataFrame) Clone() (*DataFrame, error)
- func (df *DataFrame) Close()
- func (df *DataFrame) Column(name string) (*Series, error)
- func (df *DataFrame) Columns() []string
- func (df *DataFrame) Drop(names ...string) (*DataFrame, error)
- func (df *DataFrame) DropNaNs(names ...string) (*DataFrame, error)
- func (df *DataFrame) DropNulls(names ...string) (*DataFrame, error)
- func (df *DataFrame) Explode(columns ...string) (*DataFrame, error)
- func (df *DataFrame) Filter(predicate Expr) (*DataFrame, error)
- func (df *DataFrame) ForEachRow(callback func(Row) error) error
- func (df *DataFrame) GroupBy(exprs ...Expr) *GroupBy
- func (df *DataFrame) Head(n int64) (*DataFrame, error)
- func (df *DataFrame) Height() int64
- func (df *DataFrame) IsEmpty() bool
- func (df *DataFrame) Join(other *DataFrame, leftOn, rightOn []Expr, options ...JoinOption) (*DataFrame, error)
- func (df *DataFrame) JoinAsOf(other *DataFrame, leftOn, rightOn []Expr, options ...AsOfJoinOption) (*DataFrame, error)
- func (df *DataFrame) Lazy() *LazyFrame
- func (df *DataFrame) Limit(n int64) (*DataFrame, error)
- func (df *DataFrame) Melt(on, index []string, options ...UnpivotOption) (*DataFrame, error)
- func (df *DataFrame) Release()
- func (df *DataFrame) Rename(mapping map[string]string) (*DataFrame, error)
- func (df *DataFrame) Reverse() (*DataFrame, error)
- func (df *DataFrame) Rows() ([]Row, error)
- func (df *DataFrame) Schema() Schema
- func (df *DataFrame) Select(exprs ...Expr) (*DataFrame, error)
- func (df *DataFrame) SelectSeq(exprs ...Expr) (*DataFrame, error)
- func (df *DataFrame) Shape() (int64, int)
- func (df *DataFrame) Slice(offset, length int64) (*DataFrame, error)
- func (df *DataFrame) Sort(exprs ...Expr) (*DataFrame, error)
- func (df *DataFrame) SortByColumns(names ...string) (*DataFrame, error)
- func (df *DataFrame) Tail(n int64) (*DataFrame, error)
- func (df *DataFrame) ToDicts() ([]Row, error)
- func (df *DataFrame) Unique(columns ...string) (*DataFrame, error)
- func (df *DataFrame) Unnest(columns ...string) (*DataFrame, error)
- func (df *DataFrame) Unpivot(on, index []string, options ...UnpivotOption) (*DataFrame, error)
- func (df *DataFrame) Width() int
- func (df *DataFrame) WithColumns(exprs ...Expr) (*DataFrame, error)
- func (df *DataFrame) WithColumnsSeq(exprs ...Expr) (*DataFrame, error)
- func (df *DataFrame) WriteArrow(ctx context.Context, destination string, options ...WriteOption) error
- func (df *DataFrame) WriteCSV(ctx context.Context, destination string, options ...WriteOption) error
- func (df *DataFrame) WriteIPCFile(ctx context.Context, destination string, options ...WriteOption) error
- func (df *DataFrame) WriteJSON(ctx context.Context, destination string, options ...WriteOption) error
- func (df *DataFrame) WriteNDJSON(ctx context.Context, destination string, options ...WriteOption) error
- func (df *DataFrame) WriteParquet(ctx context.Context, destination string, options ...WriteOption) error
- type DataType
- func DataTypeFromArrow(t arrow.DataType) DataType
- func Datetime(unit arrow.TimeUnit, timezone string) DataType
- func Decimal32(precision, scale int32) DataType
- func Decimal64(precision, scale int32) DataType
- func Decimal128(precision, scale int32) DataType
- func Decimal256(precision, scale int32) DataType
- func DictionaryOf(index, value DataType, ordered bool) DataType
- func Duration(unit arrow.TimeUnit) DataType
- func FixedSizeBinary(width int) DataType
- func FixedSizeListOf(length int32, elem DataType) DataType
- func LargeListOf(elem DataType) DataType
- func LargeListViewOf(elem DataType) DataType
- func ListOf(elem DataType) DataType
- func ListViewOf(elem DataType) DataType
- func MapOf(key, item DataType) DataType
- func RunEndEncodedOf(runEnds, values DataType) DataType
- func StructOf(fields ...Field) DataType
- func Time(unit arrow.TimeUnit) DataType
- func Time32(unit arrow.TimeUnit) DataType
- func Time64(unit arrow.TimeUnit) DataType
- func Timestamp(unit arrow.TimeUnit, timezone string) DataType
- func (t DataType) ArrowType() arrow.DataType
- func (t DataType) Elem() (DataType, bool)
- func (t DataType) Equal(other DataType) bool
- func (t DataType) Fields() []Field
- func (t DataType) ID() arrow.Type
- func (t DataType) IndexType() (DataType, bool)
- func (t DataType) IsCategorical() bool
- func (t DataType) IsEnum() bool
- func (t DataType) IsFloat() bool
- func (t DataType) IsInteger() bool
- func (t DataType) IsNested() bool
- func (t DataType) IsNumeric() bool
- func (t DataType) IsTemporal() bool
- func (t DataType) PrecisionScale() (precision, scale int32, ok bool)
- func (t DataType) String() string
- func (t DataType) TimeUnit() (arrow.TimeUnit, bool)
- func (t DataType) TimeZone() (string, bool)
- func (t DataType) ValueType() (DataType, bool)
- type DatasetMode
- type DatasetWriteOption
- type DtExpr
- func (d DtExpr) Date() Expr
- func (d DtExpr) Day() Expr
- func (d DtExpr) Hour() Expr
- func (d DtExpr) Minute() Expr
- func (d DtExpr) Month() Expr
- func (d DtExpr) Quarter() Expr
- func (d DtExpr) Second() Expr
- func (d DtExpr) Strftime(format string) Expr
- func (d DtExpr) Time() Expr
- func (d DtExpr) Week() Expr
- func (d DtExpr) Weekday() Expr
- func (d DtExpr) Year() Expr
- type Engine
- func (e *Engine) BatchSize() int64
- func (e *Engine) Close()
- func (e *Engine) MemoryLimit() int64
- func (e *Engine) MemoryUsed() int64
- func (e *Engine) ObjectStore(scheme string) (ObjectStore, bool)
- func (e *Engine) Parallelism() int
- func (e *Engine) ReadArrow(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) ReadCSV(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) ReadIPCFile(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) ReadJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) ReadNDJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) ReadParquet(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
- func (e *Engine) RegisterObjectStore(scheme string, store ObjectStore) error
- func (e *Engine) Scan(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanArrow(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanCSV(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanIPCFile(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanIPCStream(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanJSON(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanNDJSON(path string, options ...ScanOption) *LazyFrame
- func (e *Engine) ScanParquet(path string, options ...ScanOption) *LazyFrame
- type EngineOption
- type Expr
- func (e Expr) Abs() Expr
- func (e Expr) Add(rhs Expr) Expr
- func (e Expr) Alias(name string) Expr
- func (e Expr) All() Expr
- func (e Expr) And(rhs Expr) Expr
- func (e Expr) Any() Expr
- func (e Expr) ArgMax() Expr
- func (e Expr) ArgMin() Expr
- func (e Expr) Cast(dtype DataType) Expr
- func (e Expr) Ceil() Expr
- func (e Expr) Clip(min, max Expr) Expr
- func (e Expr) Cos() Expr
- func (e Expr) Count() Expr
- func (e Expr) CumSum() Expr
- func (e Expr) DenseRank() Expr
- func (e Expr) Desc() Expr
- func (e Expr) Div(rhs Expr) Expr
- func (e Expr) DropNaNs() Expr
- func (e Expr) DropNulls() Expr
- func (e Expr) Dt() DtExpr
- func (e Expr) Eq(rhs Expr) Expr
- func (e Expr) Exp() Expr
- func (e Expr) Explode() Expr
- func (e Expr) FillNaN(value Expr) Expr
- func (e Expr) FillNull(value Expr) Expr
- func (e Expr) First() Expr
- func (e Expr) Floor() Expr
- func (e Expr) FloorDiv(rhs Expr) Expr
- func (e Expr) Ge(rhs Expr) Expr
- func (e Expr) Gt(rhs Expr) Expr
- func (e Expr) Implode() Expr
- func (e Expr) IsBetween(lower, upper Expr) Expr
- func (e Expr) IsFinite() Expr
- func (e Expr) IsIn(values Expr) Expr
- func (e Expr) IsInfinite() Expr
- func (e Expr) IsNaN() Expr
- func (e Expr) IsNotNaN() Expr
- func (e Expr) IsNotNull() Expr
- func (e Expr) IsNull() Expr
- func (e Expr) IsValid() bool
- func (e Expr) Last() Expr
- func (e Expr) Le(rhs Expr) Expr
- func (e Expr) Len() Expr
- func (e Expr) List() ListExpr
- func (e Expr) Log() Expr
- func (e Expr) Log10() Expr
- func (e Expr) Lt(rhs Expr) Expr
- func (e Expr) Max() Expr
- func (e Expr) Mean() Expr
- func (e Expr) Median() Expr
- func (e Expr) Min() Expr
- func (e Expr) Mod(rhs Expr) Expr
- func (e Expr) Mul(rhs Expr) Expr
- func (e Expr) NUnique() Expr
- func (e Expr) Ne(rhs Expr) Expr
- func (e Expr) Neg() Expr
- func (e Expr) Not() Expr
- func (e Expr) Or(rhs Expr) Expr
- func (e Expr) Over(partitionBy ...Expr) Expr
- func (e Expr) Pow(rhs Expr) Expr
- func (e Expr) Product() Expr
- func (e Expr) Rank() Expr
- func (e Expr) Reverse() Expr
- func (e Expr) RollingMax(windowSize int64, options ...RollingOption) Expr
- func (e Expr) RollingMean(windowSize int64, options ...RollingOption) Expr
- func (e Expr) RollingMin(windowSize int64, options ...RollingOption) Expr
- func (e Expr) RollingStd(windowSize int64, options ...RollingOption) Expr
- func (e Expr) RollingSum(windowSize int64, options ...RollingOption) Expr
- func (e Expr) RollingVar(windowSize int64, options ...RollingOption) Expr
- func (e Expr) Round(decimals int) Expr
- func (e Expr) RowNumber() Expr
- func (e Expr) Shift(periods Expr) Expr
- func (e Expr) ShiftAndFill(periods, fill Expr) Expr
- func (e Expr) Sin() Expr
- func (e Expr) Slice(offset, length Expr) Expr
- func (e Expr) Sqrt() Expr
- func (e Expr) Str() StrExpr
- func (e Expr) String() string
- func (e Expr) Struct() StructExpr
- func (e Expr) Sub(rhs Expr) Expr
- func (e Expr) Sum() Expr
- func (e Expr) Tan() Expr
- func (e Expr) Unique() Expr
- type Field
- type GCSStore
- type GroupBy
- func (g *GroupBy) Agg(exprs ...Expr) (*DataFrame, error)
- func (g *GroupBy) Count() (*DataFrame, error)
- func (g *GroupBy) First() (*DataFrame, error)
- func (g *GroupBy) Last() (*DataFrame, error)
- func (g *GroupBy) Len() (*DataFrame, error)
- func (g *GroupBy) Max() (*DataFrame, error)
- func (g *GroupBy) Mean() (*DataFrame, error)
- func (g *GroupBy) Median() (*DataFrame, error)
- func (g *GroupBy) Min() (*DataFrame, error)
- func (g *GroupBy) NUnique() (*DataFrame, error)
- func (g *GroupBy) Sum() (*DataFrame, error)
- type JSONDecodeOption
- type JSONErrorMode
- type JoinOption
- type JoinType
- type LazyFrame
- func Scan(path string, options ...ScanOption) *LazyFrame
- func ScanArrow(path string, options ...ScanOption) *LazyFrame
- func ScanCSV(path string, options ...ScanOption) *LazyFrame
- func ScanCSVReader(reader io.Reader, options ...ScanOption) *LazyFrame
- func ScanIPCFile(path string, options ...ScanOption) *LazyFrame
- func ScanIPCStream(path string, options ...ScanOption) *LazyFrame
- func ScanIPCStreamReader(reader io.Reader, options ...ScanOption) *LazyFrame
- func ScanJSON(path string, options ...ScanOption) *LazyFrame
- func ScanJSONReader(reader io.Reader, options ...ScanOption) *LazyFrame
- func ScanNDJSON(path string, options ...ScanOption) *LazyFrame
- func ScanNDJSONReader(reader io.Reader, options ...ScanOption) *LazyFrame
- func ScanParquet(path string, options ...ScanOption) *LazyFrame
- func (lf *LazyFrame) Clear() *LazyFrame
- func (lf *LazyFrame) Close()
- func (lf *LazyFrame) Collect(ctx context.Context) (_ *DataFrame, err error)
- func (lf *LazyFrame) CollectBatches(ctx context.Context) ([]arrow.RecordBatch, error)
- func (lf *LazyFrame) DropNaNs(columns ...string) *LazyFrame
- func (lf *LazyFrame) Explain() string
- func (lf *LazyFrame) ExplainOptimized() string
- func (lf *LazyFrame) ExplainUnoptimized() string
- func (lf *LazyFrame) Explode(columns ...string) *LazyFrame
- func (lf *LazyFrame) Filter(predicate Expr) *LazyFrame
- func (lf *LazyFrame) ForEachBatch(ctx context.Context, callback func(arrow.RecordBatch) error) (err error)
- func (lf *LazyFrame) ForEachRow(ctx context.Context, callback func(Row) error) error
- func (lf *LazyFrame) GroupBy(keys ...Expr) *LazyGroupBy
- func (lf *LazyFrame) Head(n int64) *LazyFrame
- func (lf *LazyFrame) Height(ctx context.Context) (int64, error)
- func (lf *LazyFrame) Join(other *LazyFrame, leftOn, rightOn []Expr, options ...JoinOption) *LazyFrame
- func (lf *LazyFrame) JoinAsOf(other *LazyFrame, leftOn, rightOn []Expr, options ...AsOfJoinOption) *LazyFrame
- func (lf *LazyFrame) Limit(n int64) *LazyFrame
- func (lf *LazyFrame) Melt(on, index []string, options ...UnpivotOption) *LazyFrame
- func (lf *LazyFrame) Release()
- func (lf *LazyFrame) Reverse() *LazyFrame
- func (lf *LazyFrame) Rows(ctx context.Context) ([]Row, error)
- func (lf *LazyFrame) Schema() (Schema, error)
- func (lf *LazyFrame) Select(exprs ...Expr) *LazyFrame
- func (lf *LazyFrame) SelectSeq(exprs ...Expr) *LazyFrame
- func (lf *LazyFrame) Sink(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkArrow(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkCSV(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkIPCFile(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkIPCStream(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkJSON(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkNDJSON(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) SinkParquet(ctx context.Context, destination string, options ...WriteOption) error
- func (lf *LazyFrame) Slice(offset, length int64) *LazyFrame
- func (lf *LazyFrame) Sort(exprs ...Expr) *LazyFrame
- func (lf *LazyFrame) Tail(n int64) *LazyFrame
- func (lf *LazyFrame) ToDicts(ctx context.Context) ([]Row, error)
- func (lf *LazyFrame) Unique(columns ...string) *LazyFrame
- func (lf *LazyFrame) Unnest(columns ...string) *LazyFrame
- func (lf *LazyFrame) Unpivot(on, index []string, options ...UnpivotOption) *LazyFrame
- func (lf *LazyFrame) WithColumns(exprs ...Expr) *LazyFrame
- func (lf *LazyFrame) WithColumnsSeq(exprs ...Expr) *LazyFrame
- type LazyGroupBy
- func (g *LazyGroupBy) Agg(exprs ...Expr) *LazyFrame
- func (g *LazyGroupBy) Count() *LazyFrame
- func (g *LazyGroupBy) First() *LazyFrame
- func (g *LazyGroupBy) Last() *LazyFrame
- func (g *LazyGroupBy) Len() *LazyFrame
- func (g *LazyGroupBy) Max() *LazyFrame
- func (g *LazyGroupBy) Mean() *LazyFrame
- func (g *LazyGroupBy) Median() *LazyFrame
- func (g *LazyGroupBy) Min() *LazyFrame
- func (g *LazyGroupBy) NUnique() *LazyFrame
- func (g *LazyGroupBy) Sum() *LazyFrame
- type ListExpr
- func (l ListExpr) Contains(value Expr) Expr
- func (l ListExpr) Explode() Expr
- func (l ListExpr) First() Expr
- func (l ListExpr) Get(index Expr) Expr
- func (l ListExpr) Head(n Expr) Expr
- func (l ListExpr) Last() Expr
- func (l ListExpr) Len() Expr
- func (l ListExpr) Max() Expr
- func (l ListExpr) Mean() Expr
- func (l ListExpr) Min() Expr
- func (l ListExpr) NUnique() Expr
- func (l ListExpr) Reverse() Expr
- func (l ListExpr) Slice(offset, length Expr) Expr
- func (l ListExpr) Sum() Expr
- func (l ListExpr) Tail(n Expr) Expr
- func (l ListExpr) Unique() Expr
- type MemoryLimitError
- type ObjectInfo
- type ObjectStore
- type RangeObjectStore
- type RollingOption
- type Row
- type S3Store
- type ScanOption
- func WithColumns(columns ...string) ScanOption
- func WithComment(comment rune) ScanOption
- func WithDelimiter(delimiter rune) ScanOption
- func WithHasHeader(enabled bool) ScanOption
- func WithInferSchemaLength(rows int64) ScanOption
- func WithNRows(rows int64) ScanOption
- func WithNullValues(values ...string) ScanOption
- func WithQuoteChar(quote rune) ScanOption
- func WithScanBatchSize(rows int64) ScanOption
- func WithSkipRows(rows int64) ScanOption
- type Schema
- type Series
- func (s *Series) ArrowChunked() *arrow.Chunked
- func (s *Series) Clone() (*Series, error)
- func (s *Series) Close()
- func (s *Series) DataType() DataType
- func (s *Series) IsEmpty() bool
- func (s *Series) Len() int64
- func (s *Series) NChunks() int
- func (s *Series) Name() string
- func (s *Series) NullCount() int64
- func (s *Series) Release()
- func (s *Series) Slice(offset, length int64) (*Series, error)
- func (s *Series) ToSlice() ([]any, error)
- func (s *Series) Values() ([]any, error)
- type StrExpr
- func (s StrExpr) Contains(pattern Expr) Expr
- func (s StrExpr) EndsWith(pattern Expr) Expr
- func (s StrExpr) LenBytes() Expr
- func (s StrExpr) Lengths() Expr
- func (s StrExpr) Replace(pattern, value Expr) Expr
- func (s StrExpr) ReplaceAll(pattern, value Expr) Expr
- func (s StrExpr) Slice(offset, length Expr) Expr
- func (s StrExpr) Split(delimiter Expr) Expr
- func (s StrExpr) StartsWith(pattern Expr) Expr
- func (s StrExpr) StripChars(characters Expr) Expr
- func (s StrExpr) ToLowerCase() Expr
- func (s StrExpr) ToUpperCase() Expr
- type StructExpr
- type UnpivotOption
- type WhenThen
- type WriteOption
Constants ¶
const ( // AsOfBackward is an alias for AsofBackward. AsOfBackward = AsofBackward // AsOfForward is an alias for AsofForward. AsOfForward = AsofForward // AsOfNearest is an alias for AsofNearest. AsOfNearest = AsofNearest )
const DefaultMemoryLimit int64 = 1 << 30
DefaultMemoryLimit is the default per-engine memory quota in bytes.
Variables ¶
var ( // ErrClosed reports that a resource is closed. ErrClosed = errors.New("golars: resource is closed") // ErrColumnNotFound reports that a column is missing. ErrColumnNotFound = errors.New("golars: column not found") // ErrTypeMismatch reports an incompatible type operation. ErrTypeMismatch = errors.New("golars: type mismatch") // ErrInvalidPlan reports an invalid lazy or eager operation. ErrInvalidPlan = errors.New("golars: invalid lazy plan") )
var ( // Null is the Arrow null type. Null = DataType{arrow.Null} // Boolean is the Arrow boolean type. Boolean = DataType{arrow.FixedWidthTypes.Boolean} // Int8 is the signed 8-bit integer type. Int8 = DataType{arrow.PrimitiveTypes.Int8} // Int16 is the signed 16-bit integer type. Int16 = DataType{arrow.PrimitiveTypes.Int16} // Int32 is the signed 32-bit integer type. Int32 = DataType{arrow.PrimitiveTypes.Int32} // Int64 is the signed 64-bit integer type. Int64 = DataType{arrow.PrimitiveTypes.Int64} // Uint8 is the unsigned 8-bit integer type. Uint8 = DataType{arrow.PrimitiveTypes.Uint8} // Uint16 is the unsigned 16-bit integer type. Uint16 = DataType{arrow.PrimitiveTypes.Uint16} // Uint32 is the unsigned 32-bit integer type. Uint32 = DataType{arrow.PrimitiveTypes.Uint32} // Uint64 is the unsigned 64-bit integer type. Uint64 = DataType{arrow.PrimitiveTypes.Uint64} // Float16 is the 16-bit floating-point type. Float16 = DataType{arrow.FixedWidthTypes.Float16} // Float32 is the 32-bit floating-point type. Float32 = DataType{arrow.PrimitiveTypes.Float32} // Float64 is the 64-bit floating-point type. Float64 = DataType{arrow.PrimitiveTypes.Float64} // String is the Arrow UTF-8 string type. String = DataType{arrow.BinaryTypes.String} // LargeString is the 64-bit-offset UTF-8 string type. LargeString = DataType{arrow.BinaryTypes.LargeString} // Binary is the variable-width binary type. Binary = DataType{arrow.BinaryTypes.Binary} // LargeBinary is the 64-bit-offset binary type. LargeBinary = DataType{arrow.BinaryTypes.LargeBinary} // StringView is the Arrow string-view type. StringView = DataType{arrow.BinaryTypes.StringView} // BinaryView is the Arrow binary-view type. BinaryView = DataType{arrow.BinaryTypes.BinaryView} // Date32 is a date stored as days since the epoch. Date32 = DataType{arrow.FixedWidthTypes.Date32} // Date64 is a date stored as milliseconds since the epoch. Date64 = DataType{arrow.FixedWidthTypes.Date64} // UInt8 is an alias for Uint8. UInt8 = DataType{arrow.PrimitiveTypes.Uint8} // UInt16 is an alias for Uint16. UInt16 = DataType{arrow.PrimitiveTypes.Uint16} // UInt32 is an alias for Uint32. UInt32 = DataType{arrow.PrimitiveTypes.Uint32} // UInt64 is an alias for Uint64. UInt64 = DataType{arrow.PrimitiveTypes.Uint64} // Utf8 is an alias for String. Utf8 = DataType{arrow.BinaryTypes.String} // Date is an alias for Date32. Date = DataType{arrow.FixedWidthTypes.Date32} // Categorical is an unordered dictionary type. Categorical = DataType{&arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.String}} // Enum is an ordered dictionary type. Enum = DataType{&arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.String, Ordered: true}} // IntervalMonth is a month interval type. IntervalMonth = DataType{arrow.FixedWidthTypes.MonthInterval} // IntervalDayTime is a day-time interval type. IntervalDayTime = DataType{arrow.FixedWidthTypes.DayTimeInterval} // IntervalMonthDayNano is a month-day-nanosecond interval type. IntervalMonthDayNano = DataType{arrow.FixedWidthTypes.MonthDayNanoInterval} )
Functions ¶
func RegisterObjectStore ¶
func RegisterObjectStore(scheme string, store ObjectStore) error
RegisterObjectStore adds a store to the package default engine. This is an integration hook, not a required session lifecycle.
func WriteArrow ¶
func WriteArrow(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteArrow writes a DataFrame as an Arrow IPC file.
func WriteIPCFile ¶
func WriteIPCFile(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteIPCFile writes a DataFrame as an Arrow IPC file.
func WriteIPCStream ¶
func WriteIPCStream(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteIPCStream writes a DataFrame as an Arrow IPC stream.
func WriteJSON ¶
func WriteJSON(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteJSON writes a DataFrame as a JSON array.
func WriteNDJSON ¶
func WriteNDJSON(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteNDJSON writes a DataFrame as newline-delimited JSON.
func WriteParquet ¶
func WriteParquet(ctx context.Context, df *DataFrame, destination string, options ...WriteOption) error
WriteParquet writes a DataFrame as Parquet.
func WriteParquetDataset ¶
func WriteParquetDataset(ctx context.Context, df *DataFrame, destination string, options ...DatasetWriteOption) error
WriteParquetDataset writes a Hive-style local Parquet dataset. Create mode is non-destructive and writes _SUCCESS plus a small schema manifest; Append adds new part files without replacing existing objects.
Types ¶
type AsOfJoinOption ¶
type AsOfJoinOption func(*asofJoinConfig)
AsOfJoinOption configures an as-of join.
func WithAsOfAllowExact ¶
func WithAsOfAllowExact(enabled bool) AsOfJoinOption
WithAsOfAllowExact is an alias for WithAsofAllowExact.
func WithAsOfCheckSortedness ¶
func WithAsOfCheckSortedness(enabled bool) AsOfJoinOption
WithAsOfCheckSortedness is an alias for WithAsofCheckSortedness.
func WithAsOfStrategy ¶
func WithAsOfStrategy(strategy AsOfStrategy) AsOfJoinOption
WithAsOfStrategy is an alias for WithAsofStrategy.
func WithAsofAllowExact ¶
func WithAsofAllowExact(enabled bool) AsOfJoinOption
WithAsofAllowExact controls whether equal keys may match.
func WithAsofCheckSortedness ¶
func WithAsofCheckSortedness(enabled bool) AsOfJoinOption
WithAsofCheckSortedness asks the native engine to validate key ordering.
func WithAsofStrategy ¶
func WithAsofStrategy(strategy AsofStrategy) AsOfJoinOption
WithAsofStrategy selects backward, forward, or nearest matching.
type AsOfStrategy ¶
type AsOfStrategy = AsofStrategy
AsOfStrategy is the conventional initialism spelling of AsofStrategy.
type AsofStrategy ¶
type AsofStrategy uint8
AsofStrategy selects the nearest-key direction for an as-of join.
const ( // AsofBackward matches the last right key less than or equal to the left key. AsofBackward AsofStrategy = iota // AsofForward matches the first right key greater than or equal to the left key. AsofForward // AsofNearest matches the closest right key. AsofNearest )
func (AsofStrategy) String ¶
func (strategy AsofStrategy) String() string
type ColumnNotFoundError ¶
type ColumnNotFoundError struct {
// Name is the missing column name.
Name string
// Available lists the columns present in the frame.
Available []string
}
ColumnNotFoundError identifies the missing column and the available schema.
func (*ColumnNotFoundError) Error ¶
func (e *ColumnNotFoundError) Error() string
Error returns a description of the missing column.
func (*ColumnNotFoundError) Unwrap ¶
func (e *ColumnNotFoundError) Unwrap() error
Unwrap returns ErrColumnNotFound for errors.Is checks.
type DataFrame ¶
type DataFrame struct {
// contains filtered or unexported fields
}
DataFrame is an eager, immutable Arrow-backed table. Operations return new frames and do not mutate their receiver. Close releases its Arrow reference deterministically; the finalizer is only a safety net.
func DataFrameFromArrow ¶
DataFrameFromArrow wraps an Arrow table as a DataFrame.
func DataFrameFromMaps ¶
DataFrameFromMaps creates an eager frame from row-oriented maps. Columns are sorted by name, and a missing key is represented as null.
func DataFrameFromRecordBatch ¶
func DataFrameFromRecordBatch(batch arrow.RecordBatch) (*DataFrame, error)
DataFrameFromRecordBatch creates a DataFrame from one record batch.
func DataFrameFromRecordBatches ¶
func DataFrameFromRecordBatches(batches []arrow.RecordBatch) (*DataFrame, error)
DataFrameFromRecordBatches creates a DataFrame from schema-compatible batches.
func DataFrameFromStructs ¶
DataFrameFromStructs creates an eager frame from exported fields in rows. Field names use the json tag when present, falling back to the Go field name. A json:"-" field is omitted.
func NewDataFrame ¶
NewDataFrame creates an eager frame from columns.
func NewDataFrameFromArrow ¶
NewDataFrameFromArrow creates a DataFrame from an Arrow table.
func NewDataFrameFromMaps ¶
NewDataFrameFromMaps is an alias for DataFrameFromMaps.
func NewDataFrameFromRecordBatch ¶
func NewDataFrameFromRecordBatch(batch arrow.RecordBatch) (*DataFrame, error)
NewDataFrameFromRecordBatch creates a DataFrame from one record batch.
func NewDataFrameFromRecordBatches ¶
func NewDataFrameFromRecordBatches(batches []arrow.RecordBatch) (*DataFrame, error)
NewDataFrameFromRecordBatches creates a DataFrame from schema-compatible batches.
func NewDataFrameFromStructs ¶
NewDataFrameFromStructs is an alias for DataFrameFromStructs.
func ReadCSVReader ¶
func ReadCSVReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
ReadCSVReader reads CSV data from a reader into an eager DataFrame.
func ReadIPCFile ¶
ReadIPCFile reads an Arrow IPC file into an eager DataFrame.
func ReadIPCStreamReader ¶
func ReadIPCStreamReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
ReadIPCStreamReader reads an Arrow IPC stream from a reader into a DataFrame.
func ReadJSONReader ¶
func ReadJSONReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
ReadJSONReader reads a JSON array from a reader into a DataFrame.
func ReadNDJSON ¶
ReadNDJSON reads newline-delimited JSON into an eager DataFrame.
func ReadNDJSONReader ¶
func ReadNDJSONReader(ctx context.Context, reader io.Reader, options ...ScanOption) (*DataFrame, error)
ReadNDJSONReader reads newline-delimited JSON from a reader into a DataFrame.
func ReadParquet ¶
ReadParquet reads a Parquet path into an eager DataFrame.
func (*DataFrame) ArrowTable ¶
ArrowTable returns a retained Arrow table. The caller must Release it.
func (*DataFrame) Close ¶
func (df *DataFrame) Close()
Close releases the frame's Arrow and native resources.
func (*DataFrame) ForEachRow ¶
ForEachRow calls callback once per row in an eager DataFrame.
func (*DataFrame) Join ¶
func (df *DataFrame) Join(other *DataFrame, leftOn, rightOn []Expr, options ...JoinOption) (*DataFrame, error)
Join evaluates a join between two eager frames.
func (*DataFrame) JoinAsOf ¶
func (df *DataFrame) JoinAsOf(other *DataFrame, leftOn, rightOn []Expr, options ...AsOfJoinOption) (*DataFrame, error)
JoinAsOf evaluates a nearest-key join between two eager frames.
func (*DataFrame) Melt ¶
func (df *DataFrame) Melt(on, index []string, options ...UnpivotOption) (*DataFrame, error)
Melt is an alias for Unpivot.
func (*DataFrame) Release ¶
func (df *DataFrame) Release()
Release is an alias for Close for consistency with Arrow's reference-counted objects. Close remains the preferred name in ordinary Go code.
func (*DataFrame) SelectSeq ¶
SelectSeq evaluates a projection sequentially and returns a new frame.
func (*DataFrame) SortByColumns ¶
SortByColumns is a convenience for common column-name sorting.
func (*DataFrame) ToDicts ¶
ToDicts is a Polars-compatible alias for Rows. Go callers should prefer Rows.
func (*DataFrame) Unpivot ¶
func (df *DataFrame) Unpivot(on, index []string, options ...UnpivotOption) (*DataFrame, error)
Unpivot converts selected wide columns into variable/value rows.
func (*DataFrame) WithColumns ¶
WithColumns adds or replaces columns.
func (*DataFrame) WithColumnsSeq ¶
WithColumnsSeq evaluates column expressions sequentially.
func (*DataFrame) WriteArrow ¶
func (df *DataFrame) WriteArrow(ctx context.Context, destination string, options ...WriteOption) error
WriteArrow writes the frame as an Arrow IPC file.
func (*DataFrame) WriteCSV ¶
func (df *DataFrame) WriteCSV(ctx context.Context, destination string, options ...WriteOption) error
WriteCSV writes the frame as CSV.
func (*DataFrame) WriteIPCFile ¶
func (df *DataFrame) WriteIPCFile(ctx context.Context, destination string, options ...WriteOption) error
WriteIPCFile writes the frame as an Arrow IPC file.
func (*DataFrame) WriteJSON ¶
func (df *DataFrame) WriteJSON(ctx context.Context, destination string, options ...WriteOption) error
WriteJSON writes the frame as a JSON array.
func (*DataFrame) WriteNDJSON ¶
func (df *DataFrame) WriteNDJSON(ctx context.Context, destination string, options ...WriteOption) error
WriteNDJSON writes the frame as newline-delimited JSON.
func (*DataFrame) WriteParquet ¶
func (df *DataFrame) WriteParquet(ctx context.Context, destination string, options ...WriteOption) error
WriteParquet writes the frame as Parquet.
type DataType ¶
type DataType struct {
// contains filtered or unexported fields
}
DataType is Golars' stable type descriptor. ArrowType enables zero-copy Arrow interop.
func DataTypeFromArrow ¶
DataTypeFromArrow wraps an Arrow data type.
func Decimal128 ¶
Decimal128 creates a 128-bit decimal type.
func Decimal256 ¶
Decimal256 creates a 256-bit decimal type.
func DictionaryOf ¶
DictionaryOf creates a dictionary type.
func FixedSizeBinary ¶
FixedSizeBinary creates a fixed-width binary type.
func FixedSizeListOf ¶
FixedSizeListOf creates a fixed-length list type.
func LargeListOf ¶
LargeListOf creates a 64-bit-offset list type containing elem.
func LargeListViewOf ¶
LargeListViewOf creates a 64-bit-offset list-view type containing elem.
func ListViewOf ¶
ListViewOf creates a list-view type containing elem.
func RunEndEncodedOf ¶
RunEndEncodedOf creates a run-end encoded type.
func (DataType) IsCategorical ¶
IsCategorical reports whether the type is an unordered dictionary.
func (DataType) IsTemporal ¶
IsTemporal reports whether the type represents time.
func (DataType) PrecisionScale ¶
PrecisionScale returns decimal precision and scale.
type DatasetMode ¶
type DatasetMode uint8
DatasetMode controls whether a dataset is created or appended to.
const ( // DatasetCreate creates a new dataset. DatasetCreate DatasetMode = iota // DatasetAppend appends files to an existing dataset. DatasetAppend )
type DatasetWriteOption ¶
type DatasetWriteOption func(*datasetWriteConfig)
DatasetWriteOption configures a dataset sink.
func WithDatasetMode ¶
func WithDatasetMode(mode DatasetMode) DatasetWriteOption
WithDatasetMode sets the dataset creation mode.
func WithPartitionBy ¶
func WithPartitionBy(columns ...string) DatasetWriteOption
WithPartitionBy sets dataset partition columns.
func WithRowsPerFile ¶
func WithRowsPerFile(rows int64) DatasetWriteOption
WithRowsPerFile sets the target rows per dataset file.
type DtExpr ¶
type DtExpr struct {
// contains filtered or unexported fields
}
DtExpr provides calendar extraction from Arrow date/timestamp columns.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine owns execution configuration and memory accounting. The package API uses a lazily-created default Engine; applications only need Engine for isolation or tuning.
func NewEngine ¶
func NewEngine(options ...EngineOption) (*Engine, error)
NewEngine creates an execution engine with the supplied options.
func (*Engine) Close ¶
func (e *Engine) Close()
Close releases engine-owned stores and prevents new work.
func (*Engine) MemoryLimit ¶
MemoryLimit returns the engine memory quota in bytes.
func (*Engine) MemoryUsed ¶
MemoryUsed returns the currently accounted bytes.
func (*Engine) ObjectStore ¶
func (e *Engine) ObjectStore(scheme string) (ObjectStore, bool)
ObjectStore returns the store registered for scheme.
func (*Engine) Parallelism ¶
Parallelism returns the configured parallelism hint.
func (*Engine) ReadArrow ¶
func (e *Engine) ReadArrow(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadArrow reads an Arrow IPC file into an eager DataFrame on an Engine.
func (*Engine) ReadCSV ¶
func (e *Engine) ReadCSV(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadCSV reads a CSV path into an eager DataFrame on an Engine.
func (*Engine) ReadIPCFile ¶
func (e *Engine) ReadIPCFile(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadIPCFile reads an Arrow IPC file into an eager DataFrame on an Engine.
func (*Engine) ReadJSON ¶
func (e *Engine) ReadJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadJSON reads a JSON array into an eager DataFrame on an Engine.
func (*Engine) ReadNDJSON ¶
func (e *Engine) ReadNDJSON(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadNDJSON reads newline-delimited JSON into an eager DataFrame on an Engine.
func (*Engine) ReadParquet ¶
func (e *Engine) ReadParquet(ctx context.Context, path string, options ...ScanOption) (*DataFrame, error)
ReadParquet reads a Parquet path into an eager DataFrame on an Engine.
func (*Engine) RegisterObjectStore ¶
func (e *Engine) RegisterObjectStore(scheme string, store ObjectStore) error
RegisterObjectStore adds a store to this engine.
func (*Engine) Scan ¶
func (e *Engine) Scan(path string, options ...ScanOption) *LazyFrame
Scan creates a lazy scan on an Engine whose format is inferred from path.
func (*Engine) ScanArrow ¶
func (e *Engine) ScanArrow(path string, options ...ScanOption) *LazyFrame
ScanArrow creates a lazy Arrow IPC file scan on an Engine.
func (*Engine) ScanCSV ¶
func (e *Engine) ScanCSV(path string, options ...ScanOption) *LazyFrame
ScanCSV creates a lazy CSV scan on an Engine.
func (*Engine) ScanIPCFile ¶
func (e *Engine) ScanIPCFile(path string, options ...ScanOption) *LazyFrame
ScanIPCFile creates a lazy Arrow IPC file scan on an Engine.
func (*Engine) ScanIPCStream ¶
func (e *Engine) ScanIPCStream(path string, options ...ScanOption) *LazyFrame
ScanIPCStream creates a lazy Arrow IPC stream scan on an Engine.
func (*Engine) ScanJSON ¶
func (e *Engine) ScanJSON(path string, options ...ScanOption) *LazyFrame
ScanJSON creates a lazy JSON array scan on an Engine.
func (*Engine) ScanNDJSON ¶
func (e *Engine) ScanNDJSON(path string, options ...ScanOption) *LazyFrame
ScanNDJSON creates a lazy newline-delimited JSON scan on an Engine.
func (*Engine) ScanParquet ¶
func (e *Engine) ScanParquet(path string, options ...ScanOption) *LazyFrame
ScanParquet creates a lazy Parquet scan on an Engine.
type EngineOption ¶
type EngineOption func(*engineConfig) error
EngineOption configures an Engine.
func WithBatchSize ¶
func WithBatchSize(rows int64) EngineOption
WithBatchSize sets the preferred Arrow batch size.
func WithMemoryLimit ¶
func WithMemoryLimit(bytes int64) EngineOption
WithMemoryLimit sets the engine memory quota in bytes.
func WithObjectStore ¶
func WithObjectStore(scheme string, store ObjectStore) EngineOption
WithObjectStore registers a store for a URI scheme on an Engine.
func WithParallelism ¶
func WithParallelism(n int) EngineOption
WithParallelism sets the engine's parallelism hint.
type Expr ¶
type Expr struct {
// contains filtered or unexported fields
}
Expr is an immutable expression tree used by both eager and lazy operations.
func DecodeJSON ¶
func DecodeJSON(expr Expr, target any, options ...JSONDecodeOption) Expr
DecodeJSON parses a JSON string expression into a DataType or a Go struct value. Struct targets use exported fields and standard json tags; pointers mark nullable fields. Invalid rows become null by default.
func DecodeJSONAs ¶
func DecodeJSONAs[T any](expr Expr, options ...JSONDecodeOption) Expr
DecodeJSONAs parses JSON into the schema derived from T. It is the type-only form of DecodeJSON for callers that do not want to create a zero value.
func (Expr) IsInfinite ¶
IsInfinite tests for infinite numeric values.
func (Expr) Over ¶
Over evaluates an expression independently for each partition. Aggregate expressions (for example Col("value").Sum().Over(Col("group"))) return one value per input row, matching the shape of the input frame.
func (Expr) RollingMax ¶
func (e Expr) RollingMax(windowSize int64, options ...RollingOption) Expr
RollingMax computes a trailing fixed-size rolling maximum.
func (Expr) RollingMean ¶
func (e Expr) RollingMean(windowSize int64, options ...RollingOption) Expr
RollingMean computes a trailing fixed-size rolling mean. The default minimum period count is the window size; use WithRollingMinPeriods to override it.
func (Expr) RollingMin ¶
func (e Expr) RollingMin(windowSize int64, options ...RollingOption) Expr
RollingMin computes a trailing fixed-size rolling minimum.
func (Expr) RollingStd ¶
func (e Expr) RollingStd(windowSize int64, options ...RollingOption) Expr
RollingStd computes a trailing fixed-size rolling standard deviation.
func (Expr) RollingSum ¶
func (e Expr) RollingSum(windowSize int64, options ...RollingOption) Expr
RollingSum computes a trailing fixed-size rolling sum.
func (Expr) RollingVar ¶
func (e Expr) RollingVar(windowSize int64, options ...RollingOption) Expr
RollingVar computes a trailing fixed-size rolling variance.
func (Expr) ShiftAndFill ¶
ShiftAndFill shifts values and fills the introduced nulls.
func (Expr) Struct ¶
func (e Expr) Struct() StructExpr
Struct returns struct field operations for an expression.
type Field ¶
type Field struct {
// Name is the field name.
Name string
// Type is the field data type.
Type DataType
// Nullable reports whether the field may contain nulls.
Nullable bool
// Metadata contains Arrow field metadata.
Metadata arrow.Metadata
}
Field describes one schema field.
type GCSStore ¶
type GCSStore = internalstorage.GCSStore
GCSStore adapts Google Cloud Storage to the scan/sink API.
func NewGCSStore ¶
NewGCSStore creates a Google Cloud Storage-backed ObjectStore.
type GroupBy ¶
type GroupBy struct {
// contains filtered or unexported fields
}
GroupBy is an eager grouped aggregation builder.
type JSONDecodeOption ¶
type JSONDecodeOption func(*jsonDecodeOptions)
JSONDecodeOption configures DecodeJSON.
func WithJSONCoerce ¶
func WithJSONCoerce(enabled bool) JSONDecodeOption
WithJSONCoerce enables or disables compatible JSON-to-type coercions.
func WithJSONErrorMode ¶
func WithJSONErrorMode(mode JSONErrorMode) JSONDecodeOption
WithJSONErrorMode sets the error policy for DecodeJSON.
func WithJSONStrictRequiredFields ¶
func WithJSONStrictRequiredFields(enabled bool) JSONDecodeOption
WithJSONStrictRequiredFields makes non-nullable struct fields required.
type JSONErrorMode ¶
type JSONErrorMode uint8
JSONErrorMode controls how invalid JSON rows are handled.
const ( // JSONNullOnError replaces malformed or incompatible rows with null. JSONNullOnError JSONErrorMode = iota // JSONErrorOnError returns the first row-level decoding error. JSONErrorOnError )
type JoinOption ¶
type JoinOption func(*joinConfig)
JoinOption configures a join.
func WithJoinSuffix ¶
func WithJoinSuffix(suffix string) JoinOption
WithJoinSuffix sets the suffix for overlapping right-side columns.
type JoinType ¶
type JoinType uint8
JoinType selects the relational join semantics.
const ( // JoinInner keeps rows with matching keys from both inputs. JoinInner JoinType = iota // JoinLeft keeps every row from the left input. JoinLeft // JoinFull keeps every row from both inputs. JoinFull // JoinRight keeps every row from the right input. JoinRight // JoinSemi keeps left rows with a matching right key. JoinSemi // JoinAnti keeps left rows without a matching right key. JoinAnti // JoinCross computes the Cartesian product. JoinCross )
type LazyFrame ¶
type LazyFrame struct {
// contains filtered or unexported fields
}
LazyFrame is a deferred logical plan. Constructing transformations does not touch data; errors are returned by terminal methods. Close releases retained Arrow references deterministically; the finalizer is only a safety net.
func Scan ¶
func Scan(path string, options ...ScanOption) *LazyFrame
Scan creates a lazy scan whose format is inferred from path.
func ScanArrow ¶
func ScanArrow(path string, options ...ScanOption) *LazyFrame
ScanArrow creates a lazy Arrow IPC file scan.
func ScanCSV ¶
func ScanCSV(path string, options ...ScanOption) *LazyFrame
ScanCSV creates a lazy CSV scan.
func ScanCSVReader ¶
func ScanCSVReader(reader io.Reader, options ...ScanOption) *LazyFrame
ScanCSVReader creates a lazy CSV scan from a reader.
func ScanIPCFile ¶
func ScanIPCFile(path string, options ...ScanOption) *LazyFrame
ScanIPCFile creates a lazy Arrow IPC file scan.
func ScanIPCStream ¶
func ScanIPCStream(path string, options ...ScanOption) *LazyFrame
ScanIPCStream creates a lazy Arrow IPC stream scan.
func ScanIPCStreamReader ¶
func ScanIPCStreamReader(reader io.Reader, options ...ScanOption) *LazyFrame
ScanIPCStreamReader creates a lazy Arrow IPC stream scan from a reader.
func ScanJSON ¶
func ScanJSON(path string, options ...ScanOption) *LazyFrame
ScanJSON creates a lazy JSON array scan.
func ScanJSONReader ¶
func ScanJSONReader(reader io.Reader, options ...ScanOption) *LazyFrame
ScanJSONReader creates a lazy JSON array scan from a reader.
func ScanNDJSON ¶
func ScanNDJSON(path string, options ...ScanOption) *LazyFrame
ScanNDJSON creates a lazy newline-delimited JSON scan.
func ScanNDJSONReader ¶
func ScanNDJSONReader(reader io.Reader, options ...ScanOption) *LazyFrame
ScanNDJSONReader creates a lazy newline-delimited JSON scan from a reader.
func ScanParquet ¶
func ScanParquet(path string, options ...ScanOption) *LazyFrame
ScanParquet creates a lazy Parquet scan.
func (*LazyFrame) CollectBatches ¶
CollectBatches executes the plan and returns retained Arrow record batches.
func (*LazyFrame) DropNaNs ¶
DropNaNs removes rows containing NaN values. If columns are provided, only those columns are checked.
func (*LazyFrame) ExplainOptimized ¶
ExplainOptimized returns the Go-facing plan sent to the native optimizer.
func (*LazyFrame) ExplainUnoptimized ¶
ExplainUnoptimized returns the Go-facing plan before native collection.
func (*LazyFrame) ForEachBatch ¶
func (lf *LazyFrame) ForEachBatch(ctx context.Context, callback func(arrow.RecordBatch) error) (err error)
ForEachBatch executes the plan in Polars and iterates its Arrow result in batches. The callback receives a borrowed record batch that remains valid for the duration of the callback; retain it if it must outlive the callback.
func (*LazyFrame) ForEachRow ¶
ForEachRow calls callback once per row without materializing the complete result. Rows passed to callback are detached from the borrowed Arrow batch.
func (*LazyFrame) GroupBy ¶
func (lf *LazyFrame) GroupBy(keys ...Expr) *LazyGroupBy
GroupBy starts a lazy grouped aggregation.
func (*LazyFrame) Height ¶
Height executes a lazy plan as a stream and counts its rows without retaining the result. For an eager DataFrame, use Height directly.
func (*LazyFrame) Join ¶
func (lf *LazyFrame) Join(other *LazyFrame, leftOn, rightOn []Expr, options ...JoinOption) *LazyFrame
Join adds a deferred relational join. Keys are evaluated as expressions on both inputs, so computed keys and temporal/numeric coercion use the same expression engine as Select and Filter.
func (*LazyFrame) JoinAsOf ¶
func (lf *LazyFrame) JoinAsOf(other *LazyFrame, leftOn, rightOn []Expr, options ...AsOfJoinOption) *LazyFrame
JoinAsOf adds a deferred nearest-key join. Both inputs must be sorted by their single join expression unless sortedness checks are disabled.
func (*LazyFrame) Melt ¶
func (lf *LazyFrame) Melt(on, index []string, options ...UnpivotOption) *LazyFrame
Melt is an alias for Unpivot.
func (*LazyFrame) Release ¶
func (lf *LazyFrame) Release()
Release is an alias for Close for consistency with Arrow's reference-counted objects. Close remains the preferred name in ordinary Go code.
func (*LazyFrame) Rows ¶
Rows executes a lazy plan and materializes its result as detached row maps.
func (*LazyFrame) SinkArrow ¶
func (lf *LazyFrame) SinkArrow(ctx context.Context, destination string, options ...WriteOption) error
SinkArrow executes the plan and writes an Arrow IPC file.
func (*LazyFrame) SinkIPCFile ¶
func (lf *LazyFrame) SinkIPCFile(ctx context.Context, destination string, options ...WriteOption) error
SinkIPCFile executes the plan and writes an Arrow IPC file.
func (*LazyFrame) SinkIPCStream ¶
func (lf *LazyFrame) SinkIPCStream(ctx context.Context, destination string, options ...WriteOption) error
SinkIPCStream executes the plan and writes an Arrow IPC stream.
func (*LazyFrame) SinkJSON ¶
func (lf *LazyFrame) SinkJSON(ctx context.Context, destination string, options ...WriteOption) error
SinkJSON executes the plan and writes a JSON array.
func (*LazyFrame) SinkNDJSON ¶
func (lf *LazyFrame) SinkNDJSON(ctx context.Context, destination string, options ...WriteOption) error
SinkNDJSON executes the plan and writes newline-delimited JSON.
func (*LazyFrame) SinkParquet ¶
func (lf *LazyFrame) SinkParquet(ctx context.Context, destination string, options ...WriteOption) error
SinkParquet executes the plan and writes Parquet.
func (*LazyFrame) Slice ¶
Slice adds a row slice to the lazy plan. Negative offsets count from the end.
func (*LazyFrame) ToDicts ¶
ToDicts is a Polars-compatible alias for Rows. Go callers should prefer Rows.
func (*LazyFrame) Unpivot ¶
func (lf *LazyFrame) Unpivot(on, index []string, options ...UnpivotOption) *LazyFrame
Unpivot converts selected wide columns into variable/value rows. Columns in index remain as identifiers; when on is empty, every non-index column is unpivoted by the native engine.
func (*LazyFrame) WithColumns ¶
WithColumns adds or replaces columns in the lazy plan.
func (*LazyFrame) WithColumnsSeq ¶
WithColumnsSeq adds or replaces columns sequentially in the lazy plan.
type LazyGroupBy ¶
type LazyGroupBy struct {
// contains filtered or unexported fields
}
LazyGroupBy builds a deferred grouped aggregation.
func (*LazyGroupBy) Agg ¶
func (g *LazyGroupBy) Agg(exprs ...Expr) *LazyFrame
Agg adds grouped aggregate expressions to the lazy plan.
func (*LazyGroupBy) Count ¶
func (g *LazyGroupBy) Count() *LazyFrame
Count counts non-null values for every non-key column per group.
func (*LazyGroupBy) First ¶
func (g *LazyGroupBy) First() *LazyFrame
First returns the first value of every non-key column per group.
func (*LazyGroupBy) Last ¶
func (g *LazyGroupBy) Last() *LazyFrame
Last returns the last value of every non-key column per group.
func (*LazyGroupBy) Len ¶
func (g *LazyGroupBy) Len() *LazyFrame
Len returns one row count per group.
func (*LazyGroupBy) Max ¶
func (g *LazyGroupBy) Max() *LazyFrame
Max computes the maximum of every non-key column per group.
func (*LazyGroupBy) Mean ¶
func (g *LazyGroupBy) Mean() *LazyFrame
Mean computes the mean of every non-key column per group.
func (*LazyGroupBy) Median ¶
func (g *LazyGroupBy) Median() *LazyFrame
Median computes the median of every non-key column per group.
func (*LazyGroupBy) Min ¶
func (g *LazyGroupBy) Min() *LazyFrame
Min computes the minimum of every non-key column per group.
func (*LazyGroupBy) NUnique ¶
func (g *LazyGroupBy) NUnique() *LazyFrame
NUnique counts distinct values of every non-key column per group.
func (*LazyGroupBy) Sum ¶
func (g *LazyGroupBy) Sum() *LazyFrame
Sum sums every non-key column per group.
type ListExpr ¶
type ListExpr struct {
// contains filtered or unexported fields
}
ListExpr provides operations on list-valued expressions.
type MemoryLimitError ¶
type MemoryLimitError struct {
// Limit is the configured memory quota in bytes.
Limit int64
// Allocated is the accounted usage before the rejected allocation.
Allocated int64
// Requested is the rejected allocation size in bytes.
Requested int64
}
MemoryLimitError reports an allocation rejected by an Engine memory limit.
func (*MemoryLimitError) Error ¶
func (e *MemoryLimitError) Error() string
Error returns a description of the rejected allocation.
type ObjectInfo ¶
type ObjectInfo = internalstorage.ObjectInfo
ObjectInfo contains the metadata needed for random-access scans.
type ObjectStore ¶
type ObjectStore = internalstorage.ObjectStore
ObjectStore is the minimal storage contract used by scans and sinks. The built-in s3:// and gs:// adapters are created lazily; custom stores can be registered by URI scheme without introducing a session lifecycle.
type RangeObjectStore ¶
type RangeObjectStore = internalstorage.RangeObjectStore
RangeObjectStore is an optional extension used by Parquet scans. Stores that implement it allow metadata and column chunks to be read with range requests.
type RollingOption ¶
type RollingOption func(*rollingConfig)
RollingOption configures a fixed-size rolling expression.
func WithRollingCenter ¶
func WithRollingCenter(enabled bool) RollingOption
WithRollingCenter centers the rolling window around each row.
func WithRollingMinPeriods ¶
func WithRollingMinPeriods(periods int64) RollingOption
WithRollingMinPeriods sets the minimum number of non-null values required to produce a rolling result.
type Row ¶
Row is one DataFrame row keyed by column name. Values are Go values suitable for JSON encoding; nulls are represented by nil.
type S3Store ¶
type S3Store = internalstorage.S3Store
S3Store adapts an AWS S3-compatible object store to the scan/sink API.
func NewS3Store ¶
NewS3Store creates an S3-backed ObjectStore.
type ScanOption ¶
type ScanOption func(*scanConfig)
ScanOption configures a scan.
func WithColumns ¶
func WithColumns(columns ...string) ScanOption
WithColumns limits a scan to the named columns before executing the plan.
func WithComment ¶
func WithComment(comment rune) ScanOption
WithComment ignores CSV records beginning with comment.
func WithDelimiter ¶
func WithDelimiter(delimiter rune) ScanOption
WithDelimiter sets the delimiter for delimited input.
func WithHasHeader ¶
func WithHasHeader(enabled bool) ScanOption
WithHasHeader controls whether delimited input has a header row.
func WithInferSchemaLength ¶
func WithInferSchemaLength(rows int64) ScanOption
WithInferSchemaLength sets the number of CSV rows used for type inference. A negative value requests a full-file inference scan.
func WithNRows ¶
func WithNRows(rows int64) ScanOption
WithNRows limits the number of rows read from the source. A negative value disables the limit.
func WithNullValues ¶
func WithNullValues(values ...string) ScanOption
WithNullValues treats the supplied CSV values as null.
func WithQuoteChar ¶
func WithQuoteChar(quote rune) ScanOption
WithQuoteChar sets the CSV quote character. Passing zero disables quoting.
func WithScanBatchSize ¶
func WithScanBatchSize(rows int64) ScanOption
WithScanBatchSize sets the preferred scan batch size.
func WithSkipRows ¶
func WithSkipRows(rows int64) ScanOption
WithSkipRows skips rows before the scan's header/data rows.
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema describes a table's fields and metadata.
func NewSchemaWithMetadata ¶
NewSchemaWithMetadata creates a schema with fields and metadata.
func SchemaFromArrow ¶
SchemaFromArrow wraps an Arrow schema.
func (Schema) ArrowSchema ¶
ArrowSchema returns the underlying Arrow schema.
type Series ¶
type Series struct {
// contains filtered or unexported fields
}
Series is an immutable named Arrow chunked array. Close releases its Arrow reference deterministically; the finalizer is only a safety net.
func NewSeriesFromArrow ¶
NewSeriesFromArrow creates a series from an Arrow array.
func SeriesFromArrow ¶
SeriesFromArrow wraps an Arrow array as a series.
func SeriesFromArrowChunked ¶
SeriesFromArrowChunked wraps an Arrow chunked array as a series.
func (*Series) ArrowChunked ¶
ArrowChunked returns a retained Arrow chunked array.
func (*Series) Release ¶
func (s *Series) Release()
Release is an alias for Close for consistency with Arrow's reference-counted objects. Close remains the preferred name in ordinary Go code.
type StrExpr ¶
type StrExpr struct {
// contains filtered or unexported fields
}
StrExpr provides string kernels while keeping the main Expr namespace small.
func (StrExpr) ReplaceAll ¶
ReplaceAll replaces all matching substrings.
func (StrExpr) StartsWith ¶
StartsWith tests whether a string starts with pattern.
func (StrExpr) StripChars ¶
StripChars removes leading and trailing characters. An empty expression uses the default Unicode whitespace set.
func (StrExpr) ToLowerCase ¶
ToLowerCase converts strings to lower case.
func (StrExpr) ToUpperCase ¶
ToUpperCase converts strings to upper case.
type StructExpr ¶
type StructExpr struct {
// contains filtered or unexported fields
}
StructExpr provides access to fields in struct-valued expressions.
func (StructExpr) Element ¶
func (s StructExpr) Element(name string) Expr
Element selects a named field from a struct-valued expression.
func (StructExpr) JSONEncode ¶
func (s StructExpr) JSONEncode() Expr
JSONEncode serializes struct values as JSON strings.
func (StructExpr) Unnest ¶
func (s StructExpr) Unnest() Expr
Unnest expands struct fields into separate columns.
type UnpivotOption ¶
type UnpivotOption func(*unpivotConfig)
UnpivotOption configures the names of generated columns.
func WithUnpivotValueName ¶
func WithUnpivotValueName(name string) UnpivotOption
WithUnpivotValueName sets the generated value column name.
func WithUnpivotVariableName ¶
func WithUnpivotVariableName(name string) UnpivotOption
WithUnpivotVariableName sets the generated variable column name.
type WhenThen ¶
type WhenThen struct {
// contains filtered or unexported fields
}
WhenThen builds a conditional expression.
type WriteOption ¶
type WriteOption func(*writeConfig)
WriteOption configures a file sink.
func WithOverwrite ¶
func WithOverwrite(enabled bool) WriteOption
WithOverwrite controls whether an existing output is replaced.
func WithWriteBatchSize ¶
func WithWriteBatchSize(rows int64) WriteOption
WithWriteBatchSize sets the preferred sink batch size.
func WithWriteDelimiter ¶
func WithWriteDelimiter(delimiter rune) WriteOption
WithWriteDelimiter sets the delimiter for delimited output.
func WithWriteHeader ¶
func WithWriteHeader(enabled bool) WriteOption
WithWriteHeader controls whether delimited output includes a header row.
Source Files
¶
- arrow_helpers.go
- coercion.go
- dataframe.go
- dataset.go
- engine.go
- errors.go
- execution_scan.go
- expr.go
- expr_list.go
- expr_string.go
- expr_temporal.go
- format_json.go
- format_options.go
- format_write.go
- from_go.go
- go_schema.go
- hive_api.go
- join.go
- json_decode.go
- lazyframe.go
- native_collect.go
- native_plan.go
- parquet_api.go
- rows.go
- scan_api.go
- scan_source.go
- series_fast.go
- sink.go
- storage_api.go
- types.go