sample

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sample

type Sample struct {

	// it determines which sample action (random sample by rows / percents, sample by order and so on) to take.
	Type int
	// UsingBlock is used to speed up the sample process but will cause centroids skewed.
	// If true, the sample action will randomly stop the sample process after it has sampled enough rows.
	UsingBlock bool
	// NeedOutputRowSeen indicates whether the sample operator needs to output the count of row seen as the last column.
	NeedOutputRowSeen bool

	Rows     int
	Percents float64

	// sample(expression1, expression2, ..., number)'s expression.
	SampleExprs []*plan.Expr

	// group by expr1, expr2 ...
	GroupExprs []*plan.Expr

	vm.OperatorBase
	// contains filtered or unexported fields
}

func GenerateFromPipelineOperator

func GenerateFromPipelineOperator(opr *pipeline.Instruction) *Sample

func NewArgument added in v1.2.0

func NewArgument() *Sample

func NewMergeSample

func NewMergeSample(rowSampleArg *Sample, outputRowCount bool) *Sample

func NewSampleByPercent

func NewSampleByPercent(percent float64, sampleExprs, groupExprs []*plan.Expr) *Sample

func NewSampleByRows

func NewSampleByRows(rows int, sampleExprs, groupExprs []*plan.Expr, usingRow bool, outputRowCount bool) *Sample

func (*Sample) Call

func (sample *Sample) Call(proc *process.Process) (vm.CallResult, error)

func (*Sample) ConvertToPipelineOperator

func (sample *Sample) ConvertToPipelineOperator(in *pipeline.Instruction)

func (*Sample) ExecProjection

func (sample *Sample) ExecProjection(proc *process.Process, input *batch.Batch) (*batch.Batch, error)

func (*Sample) Free

func (sample *Sample) Free(proc *process.Process, pipelineFailed bool, err error)

func (*Sample) GetOperatorBase

func (sample *Sample) GetOperatorBase() *vm.OperatorBase

func (*Sample) IsByPercent

func (sample *Sample) IsByPercent() bool

func (*Sample) IsMergeSampleByRow

func (sample *Sample) IsMergeSampleByRow() bool

func (*Sample) OpType

func (sample *Sample) OpType() vm.OpType

func (*Sample) Prepare

func (sample *Sample) Prepare(proc *process.Process) (err error)

func (*Sample) Release

func (sample *Sample) Release()

func (*Sample) Reset

func (sample *Sample) Reset(proc *process.Process, pipelineFailed bool, err error)

func (*Sample) SampleDup

func (sample *Sample) SampleDup() *Sample

func (*Sample) String

func (sample *Sample) String(buf *bytes.Buffer)

func (Sample) TypeName

func (sample Sample) TypeName() string

Jump to

Keyboard shortcuts

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