Documentation
¶
Index ¶
- func DataTypeForExprWithSchema(expr Expr, s *dynparquet.Schema) (arrow.DataType, error)
- func Validate(plan *LogicalPlan) error
- type AggFunc
- type AggFuncPushDown
- type Aggregation
- type AggregationFunction
- func (f *AggregationFunction) Accept(visitor Visitor) bool
- func (f *AggregationFunction) Alias(alias string) *AliasExpr
- func (f *AggregationFunction) Clone() Expr
- func (f *AggregationFunction) ColumnsUsedExprs() []Expr
- func (f *AggregationFunction) Computed() bool
- func (f *AggregationFunction) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (f *AggregationFunction) Equal(other Expr) bool
- func (f *AggregationFunction) MatchColumn(columnName string) bool
- func (f *AggregationFunction) MatchPath(path string) bool
- func (f *AggregationFunction) Name() string
- func (f *AggregationFunction) String() string
- type AliasExpr
- func (e *AliasExpr) Accept(visitor Visitor) bool
- func (e *AliasExpr) Clone() Expr
- func (e *AliasExpr) ColumnsUsedExprs() []Expr
- func (e *AliasExpr) Computed() bool
- func (e *AliasExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (e *AliasExpr) Equal(other Expr) bool
- func (e *AliasExpr) MatchColumn(columnName string) bool
- func (e *AliasExpr) MatchPath(path string) bool
- func (e *AliasExpr) Name() string
- func (e *AliasExpr) String() string
- type AllExpr
- func (a *AllExpr) Accept(visitor Visitor) bool
- func (a *AllExpr) Clone() Expr
- func (a *AllExpr) ColumnsUsedExprs() []Expr
- func (a *AllExpr) Computed() bool
- func (a *AllExpr) DataType(ExprTypeFinder) (arrow.DataType, error)
- func (a *AllExpr) Equal(other Expr) bool
- func (a *AllExpr) MatchColumn(_ string) bool
- func (a *AllExpr) MatchPath(_ string) bool
- func (a *AllExpr) Name() string
- func (a *AllExpr) String() string
- type BinaryExpr
- func (e *BinaryExpr) Accept(visitor Visitor) bool
- func (e *BinaryExpr) Alias(alias string) *AliasExpr
- func (e *BinaryExpr) Clone() Expr
- func (e *BinaryExpr) ColumnsUsedExprs() []Expr
- func (e *BinaryExpr) Computed() bool
- func (e *BinaryExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (e *BinaryExpr) Equal(other Expr) bool
- func (e *BinaryExpr) MatchColumn(columnName string) bool
- func (e *BinaryExpr) MatchPath(path string) bool
- func (e *BinaryExpr) Name() string
- func (e *BinaryExpr) String() string
- type Builder
- func (b Builder) Aggregate(aggExpr []*AggregationFunction, groupExprs []Expr) Builder
- func (b Builder) Build() (*LogicalPlan, error)
- func (b Builder) Distinct(exprs ...Expr) Builder
- func (b Builder) Filter(expr Expr) Builder
- func (b Builder) Limit(expr Expr) Builder
- func (b Builder) Project(exprs ...Expr) Builder
- func (b Builder) Sample(expr, limit Expr) Builder
- func (b Builder) Scan(provider TableProvider, tableName string) Builder
- func (b Builder) ScanSchema(provider TableProvider, tableName string) Builder
- type Callback
- type Column
- func (c *Column) Accept(visitor Visitor) bool
- func (c *Column) Alias(alias string) *AliasExpr
- func (c *Column) Clone() Expr
- func (c *Column) ColumnsUsedExprs() []Expr
- func (c *Column) Computed() bool
- func (c *Column) Contains(pattern string) *BinaryExpr
- func (c *Column) ContainsNot(pattern string) *BinaryExpr
- func (c *Column) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (c *Column) Eq(e Expr) *BinaryExpr
- func (c *Column) Equal(other Expr) bool
- func (c *Column) Gt(e Expr) *BinaryExpr
- func (c *Column) GtEq(e Expr) *BinaryExpr
- func (c *Column) Lt(e Expr) *BinaryExpr
- func (c *Column) LtEq(e Expr) *BinaryExpr
- func (c *Column) MatchColumn(columnName string) bool
- func (c *Column) MatchPath(path string) bool
- func (c *Column) Name() string
- func (c *Column) NotEq(e Expr) *BinaryExpr
- func (c *Column) RegexMatch(pattern string) *BinaryExpr
- func (c *Column) RegexNotMatch(pattern string) *BinaryExpr
- func (c *Column) String() string
- type ConvertExpr
- func (e *ConvertExpr) Accept(visitor Visitor) bool
- func (e *ConvertExpr) Alias(alias string) *AliasExpr
- func (e *ConvertExpr) Clone() Expr
- func (e *ConvertExpr) ColumnsUsedExprs() []Expr
- func (e *ConvertExpr) Computed() bool
- func (e *ConvertExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (e *ConvertExpr) Equal(other Expr) bool
- func (e *ConvertExpr) MatchColumn(columnName string) bool
- func (e *ConvertExpr) MatchPath(path string) bool
- func (e *ConvertExpr) Name() string
- func (e *ConvertExpr) String() string
- type Distinct
- type DistinctPushDown
- type DurationExpr
- func (d *DurationExpr) Accept(visitor Visitor) bool
- func (d *DurationExpr) Clone() Expr
- func (d *DurationExpr) ColumnsUsedExprs() []Expr
- func (d *DurationExpr) Computed() bool
- func (d *DurationExpr) DataType(_ ExprTypeFinder) (arrow.DataType, error)
- func (d *DurationExpr) Equal(other Expr) bool
- func (d *DurationExpr) MatchColumn(columnName string) bool
- func (d *DurationExpr) MatchPath(_ string) bool
- func (d *DurationExpr) Name() string
- func (d *DurationExpr) String() string
- func (d *DurationExpr) Value() time.Duration
- type DynamicColumn
- func (c *DynamicColumn) Accept(visitor Visitor) bool
- func (c *DynamicColumn) Clone() Expr
- func (c *DynamicColumn) ColumnsUsedExprs() []Expr
- func (c *DynamicColumn) Computed() bool
- func (c *DynamicColumn) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (c *DynamicColumn) Equal(other Expr) bool
- func (c *DynamicColumn) MatchColumn(columnName string) bool
- func (c *DynamicColumn) MatchPath(path string) bool
- func (c *DynamicColumn) Name() string
- func (c *DynamicColumn) String() string
- type Expr
- type ExprTypeFinder
- type ExprValidationError
- func ValidateAggregationExpr(plan *LogicalPlan) *ExprValidationError
- func ValidateComparingTypes(columnType *format.LogicalType, literal scalar.Scalar) *ExprValidationError
- func ValidateFilterAndBinaryExpr(plan *LogicalPlan, expr *BinaryExpr) *ExprValidationError
- func ValidateFilterBinaryExpr(plan *LogicalPlan, expr *BinaryExpr) *ExprValidationError
- func ValidateFilterExpr(plan *LogicalPlan, e Expr) *ExprValidationError
- type Filter
- type FilterPushDown
- type IfExpr
- func (e *IfExpr) Accept(visitor Visitor) bool
- func (e *IfExpr) Alias(name string) *AliasExpr
- func (e *IfExpr) Clone() Expr
- func (e *IfExpr) ColumnsUsedExprs() []Expr
- func (e *IfExpr) Computed() bool
- func (e *IfExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (e *IfExpr) Equal(other Expr) bool
- func (e *IfExpr) MatchColumn(columnName string) bool
- func (e *IfExpr) MatchPath(path string) bool
- func (e *IfExpr) Name() string
- func (e *IfExpr) String() string
- type IsNullExpr
- func (e *IsNullExpr) Accept(visitor Visitor) bool
- func (e *IsNullExpr) Clone() Expr
- func (e *IsNullExpr) ColumnsUsedExprs() []Expr
- func (e *IsNullExpr) Computed() bool
- func (e *IsNullExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (e *IsNullExpr) Equal(other Expr) bool
- func (e *IsNullExpr) MatchColumn(columnName string) bool
- func (e *IsNullExpr) MatchPath(path string) bool
- func (e *IsNullExpr) Name() string
- func (e *IsNullExpr) String() string
- type IterOptions
- type Limit
- type LiteralExpr
- func (e *LiteralExpr) Accept(visitor Visitor) bool
- func (e *LiteralExpr) Clone() Expr
- func (e *LiteralExpr) ColumnsUsedExprs() []Expr
- func (e *LiteralExpr) Computed() bool
- func (e *LiteralExpr) DataType(_ ExprTypeFinder) (arrow.DataType, error)
- func (e *LiteralExpr) Equal(other Expr) bool
- func (e *LiteralExpr) MatchColumn(columnName string) bool
- func (e *LiteralExpr) MatchPath(path string) bool
- func (e *LiteralExpr) Name() string
- func (e *LiteralExpr) String() string
- type LogicalPlan
- type Named
- type NotExpr
- func (n *NotExpr) Accept(visitor Visitor) bool
- func (n *NotExpr) Clone() Expr
- func (n *NotExpr) ColumnsUsedExprs() []Expr
- func (n *NotExpr) Computed() bool
- func (n *NotExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
- func (n *NotExpr) Equal(other Expr) bool
- func (n *NotExpr) MatchColumn(columnName string) bool
- func (n *NotExpr) MatchPath(path string) bool
- func (n *NotExpr) Name() string
- func (n *NotExpr) String() string
- type Op
- type Optimizer
- type Option
- type PhysicalProjectionPushDown
- type PlanValidationError
- func ValidateAggregation(plan *LogicalPlan) *PlanValidationError
- func ValidateFilter(plan *LogicalPlan) *PlanValidationError
- func ValidateInput(plan *LogicalPlan) *PlanValidationError
- func ValidateSchemaScan(plan *LogicalPlan) *PlanValidationError
- func ValidateSingleFieldSet(plan *LogicalPlan) *PlanValidationError
- func ValidateTableScan(plan *LogicalPlan) *PlanValidationError
- type PlanVisitor
- type Projection
- type ReadMode
- type Sample
- type SchemaScan
- type TableProvider
- type TableReader
- type TableScan
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggFuncPushDown ¶
type AggFuncPushDown struct{}
AggFuncPushDown optimizer tries to push down an aggregation function operator to the table provider. This can be done in the case of some aggregation functions on global aggregations (i.e. no group by) without filters. The storage engine can make smarter decisions than just returning all the data, such as in the case of max functions, memoizing the max value seen so far and only scanning row groups that contain a value greater than the memoized value. It modifies the plan in place.
func (*AggFuncPushDown) Optimize ¶
func (p *AggFuncPushDown) Optimize(plan *LogicalPlan) *LogicalPlan
type Aggregation ¶
type Aggregation struct { AggExprs []*AggregationFunction GroupExprs []Expr }
func (*Aggregation) String ¶
func (a *Aggregation) String() string
type AggregationFunction ¶
func AndAgg ¶
func AndAgg(expr Expr) *AggregationFunction
func Avg ¶
func Avg(expr Expr) *AggregationFunction
func Count ¶
func Count(expr Expr) *AggregationFunction
func Max ¶
func Max(expr Expr) *AggregationFunction
func Min ¶
func Min(expr Expr) *AggregationFunction
func Sum ¶
func Sum(expr Expr) *AggregationFunction
func Unique ¶
func Unique(expr Expr) *AggregationFunction
func (*AggregationFunction) Accept ¶
func (f *AggregationFunction) Accept(visitor Visitor) bool
func (*AggregationFunction) Alias ¶
func (f *AggregationFunction) Alias(alias string) *AliasExpr
func (*AggregationFunction) Clone ¶
func (f *AggregationFunction) Clone() Expr
func (*AggregationFunction) ColumnsUsedExprs ¶
func (f *AggregationFunction) ColumnsUsedExprs() []Expr
func (*AggregationFunction) Computed ¶
func (f *AggregationFunction) Computed() bool
func (*AggregationFunction) DataType ¶
func (f *AggregationFunction) DataType(l ExprTypeFinder) (arrow.DataType, error)
func (*AggregationFunction) Equal ¶
func (f *AggregationFunction) Equal(other Expr) bool
func (*AggregationFunction) MatchColumn ¶
func (f *AggregationFunction) MatchColumn(columnName string) bool
func (*AggregationFunction) MatchPath ¶
func (f *AggregationFunction) MatchPath(path string) bool
func (*AggregationFunction) Name ¶
func (f *AggregationFunction) Name() string
func (*AggregationFunction) String ¶
func (f *AggregationFunction) String() string
type AllExpr ¶
type AllExpr struct{}
func (*AllExpr) ColumnsUsedExprs ¶
func (*AllExpr) MatchColumn ¶
type BinaryExpr ¶
func Add ¶
func Add(left, right Expr) *BinaryExpr
func Div ¶
func Div(left, right Expr) *BinaryExpr
func Mul ¶
func Mul(left, right Expr) *BinaryExpr
func Sub ¶
func Sub(left, right Expr) *BinaryExpr
func (*BinaryExpr) Accept ¶
func (e *BinaryExpr) Accept(visitor Visitor) bool
func (*BinaryExpr) Alias ¶
func (e *BinaryExpr) Alias(alias string) *AliasExpr
func (*BinaryExpr) Clone ¶
func (e *BinaryExpr) Clone() Expr
func (*BinaryExpr) ColumnsUsedExprs ¶
func (e *BinaryExpr) ColumnsUsedExprs() []Expr
func (*BinaryExpr) Computed ¶
func (e *BinaryExpr) Computed() bool
func (*BinaryExpr) DataType ¶
func (e *BinaryExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
func (*BinaryExpr) Equal ¶
func (e *BinaryExpr) Equal(other Expr) bool
func (*BinaryExpr) MatchColumn ¶
func (e *BinaryExpr) MatchColumn(columnName string) bool
func (*BinaryExpr) MatchPath ¶
func (e *BinaryExpr) MatchPath(path string) bool
func (*BinaryExpr) Name ¶
func (e *BinaryExpr) Name() string
func (*BinaryExpr) String ¶
func (e *BinaryExpr) String() string
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (Builder) Aggregate ¶
func (b Builder) Aggregate( aggExpr []*AggregationFunction, groupExprs []Expr, ) Builder
func (Builder) Build ¶
func (b Builder) Build() (*LogicalPlan, error)
func (Builder) ScanSchema ¶
func (b Builder) ScanSchema( provider TableProvider, tableName string, ) Builder
type Callback ¶
Callback is a function that is called throughout a chain of operators modifying the underlying data.
type Column ¶
type Column struct {
ColumnName string
}
func (*Column) ColumnsUsedExprs ¶
func (*Column) Contains ¶
func (c *Column) Contains(pattern string) *BinaryExpr
func (*Column) ContainsNot ¶
func (c *Column) ContainsNot(pattern string) *BinaryExpr
func (*Column) Eq ¶
func (c *Column) Eq(e Expr) *BinaryExpr
func (*Column) Gt ¶
func (c *Column) Gt(e Expr) *BinaryExpr
func (*Column) GtEq ¶
func (c *Column) GtEq(e Expr) *BinaryExpr
func (*Column) Lt ¶
func (c *Column) Lt(e Expr) *BinaryExpr
func (*Column) LtEq ¶
func (c *Column) LtEq(e Expr) *BinaryExpr
func (*Column) MatchColumn ¶
func (*Column) NotEq ¶
func (c *Column) NotEq(e Expr) *BinaryExpr
func (*Column) RegexMatch ¶
func (c *Column) RegexMatch(pattern string) *BinaryExpr
func (*Column) RegexNotMatch ¶
func (c *Column) RegexNotMatch(pattern string) *BinaryExpr
type ConvertExpr ¶
func (*ConvertExpr) Accept ¶
func (e *ConvertExpr) Accept(visitor Visitor) bool
func (*ConvertExpr) Alias ¶
func (e *ConvertExpr) Alias(alias string) *AliasExpr
func (*ConvertExpr) Clone ¶
func (e *ConvertExpr) Clone() Expr
func (*ConvertExpr) ColumnsUsedExprs ¶
func (e *ConvertExpr) ColumnsUsedExprs() []Expr
func (*ConvertExpr) Computed ¶
func (e *ConvertExpr) Computed() bool
func (*ConvertExpr) DataType ¶
func (e *ConvertExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
func (*ConvertExpr) Equal ¶
func (e *ConvertExpr) Equal(other Expr) bool
func (*ConvertExpr) MatchColumn ¶
func (e *ConvertExpr) MatchColumn(columnName string) bool
func (*ConvertExpr) MatchPath ¶
func (e *ConvertExpr) MatchPath(path string) bool
func (*ConvertExpr) Name ¶
func (e *ConvertExpr) Name() string
func (*ConvertExpr) String ¶
func (e *ConvertExpr) String() string
type DistinctPushDown ¶
type DistinctPushDown struct{}
DistinctPushDown optimizer tries to push down the distinct operator to the table provider. There are certain cases of distinct queries where the storage engine can make smarter decisions than just returning all the data, such as with dictionary encoded columns that are not filtered they can return only the dictionary avoiding unnecessary decoding and deduplication in downstream distinct operators. It modifies the plan in place.
func (*DistinctPushDown) Optimize ¶
func (p *DistinctPushDown) Optimize(plan *LogicalPlan) *LogicalPlan
type DurationExpr ¶
type DurationExpr struct {
// contains filtered or unexported fields
}
func Duration ¶
func Duration(d time.Duration) *DurationExpr
func (*DurationExpr) Accept ¶
func (d *DurationExpr) Accept(visitor Visitor) bool
func (*DurationExpr) Clone ¶
func (d *DurationExpr) Clone() Expr
func (*DurationExpr) ColumnsUsedExprs ¶
func (d *DurationExpr) ColumnsUsedExprs() []Expr
func (*DurationExpr) Computed ¶
func (d *DurationExpr) Computed() bool
func (*DurationExpr) DataType ¶
func (d *DurationExpr) DataType(_ ExprTypeFinder) (arrow.DataType, error)
func (*DurationExpr) Equal ¶
func (d *DurationExpr) Equal(other Expr) bool
func (*DurationExpr) MatchColumn ¶
func (d *DurationExpr) MatchColumn(columnName string) bool
func (*DurationExpr) MatchPath ¶
func (d *DurationExpr) MatchPath(_ string) bool
func (*DurationExpr) Name ¶
func (d *DurationExpr) Name() string
func (*DurationExpr) String ¶
func (d *DurationExpr) String() string
func (*DurationExpr) Value ¶
func (d *DurationExpr) Value() time.Duration
type DynamicColumn ¶
type DynamicColumn struct {
ColumnName string
}
func DynCol ¶
func DynCol(name string) *DynamicColumn
func (*DynamicColumn) Accept ¶
func (c *DynamicColumn) Accept(visitor Visitor) bool
func (*DynamicColumn) Clone ¶
func (c *DynamicColumn) Clone() Expr
func (*DynamicColumn) ColumnsUsedExprs ¶
func (c *DynamicColumn) ColumnsUsedExprs() []Expr
func (*DynamicColumn) Computed ¶
func (c *DynamicColumn) Computed() bool
func (*DynamicColumn) DataType ¶
func (c *DynamicColumn) DataType(l ExprTypeFinder) (arrow.DataType, error)
func (*DynamicColumn) Equal ¶
func (c *DynamicColumn) Equal(other Expr) bool
func (*DynamicColumn) MatchColumn ¶
func (c *DynamicColumn) MatchColumn(columnName string) bool
func (*DynamicColumn) MatchPath ¶
func (c *DynamicColumn) MatchPath(path string) bool
func (*DynamicColumn) Name ¶
func (c *DynamicColumn) Name() string
func (*DynamicColumn) String ¶
func (c *DynamicColumn) String() string
type Expr ¶
type Expr interface { DataType(ExprTypeFinder) (arrow.DataType, error) Accept(Visitor) bool Name() string Equal(Expr) bool fmt.Stringer // ColumnsUsedExprs extracts all the expressions that are used that cause // physical data to be read from a column. ColumnsUsedExprs() []Expr // MatchColumn returns whether it would operate on the passed column. In // contrast to the ColumnUsedExprs function from the Expr interface, it is not // useful to identify which columns are to be read physically. This is // necessary to distinguish between projections. // // Take the example of a column that projects `XYZ > 0`. Matcher can be // used to identify the column in the resulting Apache Arrow frames, while // ColumnsUsed will return `XYZ` to be necessary to be loaded physically. MatchColumn(columnName string) bool // MatchPath returns whether it would operate on the passed path. This is nessesary for nested schemas. MatchPath(path string) bool // Computed returns whether the expression is computed as opposed to being // a static value or unmodified physical column. Computed() bool // Clone returns a deep copy of the expression. Clone() Expr }
type ExprTypeFinder ¶
type ExprValidationError ¶
type ExprValidationError struct {
// contains filtered or unexported fields
}
ExprValidationError is the error for an invalid expression that was found during validation.
func ValidateAggregationExpr ¶
func ValidateAggregationExpr(plan *LogicalPlan) *ExprValidationError
func ValidateComparingTypes ¶
func ValidateComparingTypes(columnType *format.LogicalType, literal scalar.Scalar) *ExprValidationError
ValidateComparingTypes validates if the types being compared by a binary expression are compatible.
func ValidateFilterAndBinaryExpr ¶
func ValidateFilterAndBinaryExpr(plan *LogicalPlan, expr *BinaryExpr) *ExprValidationError
ValidateFilterAndBinaryExpr validates the filter's binary expression where Op = AND.
func ValidateFilterBinaryExpr ¶
func ValidateFilterBinaryExpr(plan *LogicalPlan, expr *BinaryExpr) *ExprValidationError
ValidateFilterBinaryExpr validates the filter's binary expression.
func ValidateFilterExpr ¶
func ValidateFilterExpr(plan *LogicalPlan, e Expr) *ExprValidationError
ValidateFilterExpr validates filter's expression.
func (*ExprValidationError) Error ¶
func (e *ExprValidationError) Error() string
ExprValidationError.Error prints the error message in a human-readable format. implements the error interface.
type FilterPushDown ¶
type FilterPushDown struct{}
FilterPushDown optimizer tries to push down the filters of a query down to the actual physical table scan. This allows the table provider to make smarter decisions about which pieces of data to load in the first place or which are definitely not useful to the query at all. It does not guarantee that all data will be filtered accordingly, it is just a mechanism to read less data from disk. It modifies the plan in place.
func (*FilterPushDown) Optimize ¶
func (p *FilterPushDown) Optimize(plan *LogicalPlan) *LogicalPlan
type IsNullExpr ¶
type IsNullExpr struct {
Expr Expr
}
func IsNull ¶
func IsNull(expr Expr) *IsNullExpr
func (*IsNullExpr) Accept ¶
func (e *IsNullExpr) Accept(visitor Visitor) bool
func (*IsNullExpr) Clone ¶
func (e *IsNullExpr) Clone() Expr
func (*IsNullExpr) ColumnsUsedExprs ¶
func (e *IsNullExpr) ColumnsUsedExprs() []Expr
func (*IsNullExpr) Computed ¶
func (e *IsNullExpr) Computed() bool
func (*IsNullExpr) DataType ¶
func (e *IsNullExpr) DataType(l ExprTypeFinder) (arrow.DataType, error)
func (*IsNullExpr) Equal ¶
func (e *IsNullExpr) Equal(other Expr) bool
func (*IsNullExpr) MatchColumn ¶
func (e *IsNullExpr) MatchColumn(columnName string) bool
func (*IsNullExpr) MatchPath ¶
func (e *IsNullExpr) MatchPath(path string) bool
func (*IsNullExpr) Name ¶
func (e *IsNullExpr) Name() string
func (*IsNullExpr) String ¶
func (e *IsNullExpr) String() string
type IterOptions ¶
type IterOptions struct { PhysicalProjection []Expr Projection []Expr Filter Expr DistinctColumns []Expr ReadMode ReadMode }
IterOptions are a set of options for the TableReader Iterators.
type LiteralExpr ¶
func Literal ¶
func Literal(v interface{}) *LiteralExpr
func (*LiteralExpr) Accept ¶
func (e *LiteralExpr) Accept(visitor Visitor) bool
func (*LiteralExpr) Clone ¶
func (e *LiteralExpr) Clone() Expr
func (*LiteralExpr) ColumnsUsedExprs ¶
func (e *LiteralExpr) ColumnsUsedExprs() []Expr
func (*LiteralExpr) Computed ¶
func (e *LiteralExpr) Computed() bool
func (*LiteralExpr) DataType ¶
func (e *LiteralExpr) DataType(_ ExprTypeFinder) (arrow.DataType, error)
func (*LiteralExpr) Equal ¶
func (e *LiteralExpr) Equal(other Expr) bool
func (*LiteralExpr) MatchColumn ¶
func (e *LiteralExpr) MatchColumn(columnName string) bool
func (*LiteralExpr) MatchPath ¶
func (e *LiteralExpr) MatchPath(path string) bool
func (*LiteralExpr) Name ¶
func (e *LiteralExpr) Name() string
func (*LiteralExpr) String ¶
func (e *LiteralExpr) String() string
type LogicalPlan ¶
type LogicalPlan struct { Input *LogicalPlan // Each LogicalPlan struct must only have one of the following. SchemaScan *SchemaScan TableScan *TableScan Filter *Filter Distinct *Distinct Projection *Projection Aggregation *Aggregation Limit *Limit Sample *Sample }
LogicalPlan is a logical representation of a query. Each LogicalPlan is a sub-tree of the query. It is built recursively.
func (*LogicalPlan) Accept ¶
func (plan *LogicalPlan) Accept(visitor PlanVisitor) bool
func (*LogicalPlan) DataTypeForExpr ¶
func (plan *LogicalPlan) DataTypeForExpr(expr Expr) (arrow.DataType, error)
func (*LogicalPlan) InputSchema ¶
func (plan *LogicalPlan) InputSchema() *dynparquet.Schema
InputSchema returns the schema that the query will execute against.
func (*LogicalPlan) String ¶
func (plan *LogicalPlan) String() string
func (*LogicalPlan) TableReader ¶
func (plan *LogicalPlan) TableReader() (TableReader, error)
TableReader returns the table reader.
type NotExpr ¶
type NotExpr struct {
Expr Expr
}
func (*NotExpr) ColumnsUsedExprs ¶
func (*NotExpr) MatchColumn ¶
type Optimizer ¶
type Optimizer interface {
Optimize(plan *LogicalPlan) *LogicalPlan
}
func DefaultOptimizers ¶
func DefaultOptimizers() []Optimizer
type Option ¶
type Option func(opts *IterOptions)
func WithDistinctColumns ¶
func WithFilter ¶
func WithPhysicalProjection ¶
func WithProjection ¶
func WithReadMode ¶
type PhysicalProjectionPushDown ¶
type PhysicalProjectionPushDown struct {
// contains filtered or unexported fields
}
PhysicalProjectionPushDown finds the first projecting logical plan and collects all columns it needs, it is concatenated with all other columns used until it, for example a filter layer. Because the tree has the scan layer as the inner most layer, the logic actually works by resetting the list every time a projecting layer is found.
func (*PhysicalProjectionPushDown) Optimize ¶
func (p *PhysicalProjectionPushDown) Optimize(plan *LogicalPlan) *LogicalPlan
type PlanValidationError ¶
type PlanValidationError struct {
// contains filtered or unexported fields
}
PlanValidationError is the error representing a logical plan that is not valid.
func ValidateAggregation ¶
func ValidateAggregation(plan *LogicalPlan) *PlanValidationError
ValidateAggregation validates the logical plan's aggregation step.
func ValidateFilter ¶
func ValidateFilter(plan *LogicalPlan) *PlanValidationError
ValidateFilter validates the logical plan's filter step.
func ValidateInput ¶
func ValidateInput(plan *LogicalPlan) *PlanValidationError
ValidateInput validates that the current logical plans input is valid. It returns nil if the plan has no input.
func ValidateSchemaScan ¶
func ValidateSchemaScan(plan *LogicalPlan) *PlanValidationError
func ValidateSingleFieldSet ¶
func ValidateSingleFieldSet(plan *LogicalPlan) *PlanValidationError
ValidateSingleFieldSet checks that only a single field is set on the plan.
func ValidateTableScan ¶
func ValidateTableScan(plan *LogicalPlan) *PlanValidationError
func (*PlanValidationError) Error ¶
func (e *PlanValidationError) Error() string
PlanValidationError.Error prints the error message in a human-readable format. implements the error interface.
type PlanVisitor ¶
type PlanVisitor interface { PreVisit(plan *LogicalPlan) bool PostVisit(plan *LogicalPlan) bool }
type Projection ¶
type Projection struct {
Exprs []Expr
}
func (*Projection) String ¶
func (p *Projection) String() string
type SchemaScan ¶
type SchemaScan struct { TableProvider TableProvider TableName string // PhysicalProjection describes the columns that are to be physically read // by the table scan. PhysicalProjection []Expr // filter is the predicate that is to be applied by the table scan to rule // out any blocks of data to be scanned at all. Filter Expr // Distinct describes the columns that are to be distinct. Distinct []Expr // Projection is the list of columns that are to be projected. Projection []Expr // ReadMode indicates the mode to use when reading. ReadMode ReadMode }
func (*SchemaScan) DataTypeForExpr ¶
func (s *SchemaScan) DataTypeForExpr(expr Expr) (arrow.DataType, error)
func (*SchemaScan) String ¶
func (s *SchemaScan) String() string
type TableProvider ¶
type TableProvider interface {
GetTable(name string) (TableReader, error)
}
type TableReader ¶
type TableReader interface { View(ctx context.Context, fn func(ctx context.Context, tx uint64) error) error Iterator( ctx context.Context, tx uint64, pool memory.Allocator, callbacks []Callback, options ...Option, ) error SchemaIterator( ctx context.Context, tx uint64, pool memory.Allocator, callbacks []Callback, options ...Option, ) error Schema() *dynparquet.Schema }
type TableScan ¶
type TableScan struct { TableProvider TableProvider TableName string // PhysicalProjection describes the columns that are to be physically read // by the table scan. This is an Expr so it can be either a column or // dynamic column. PhysicalProjection []Expr // Filter is the predicate that is to be applied by the table scan to rule // out any blocks of data to be scanned at all. Filter Expr // Distinct describes the columns that are to be distinct. Distinct []Expr // Projection is the list of columns that are to be projected. Projection []Expr // ReadMode indicates the mode to use when reading. ReadMode ReadMode }