sorter

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortRows

func SortRows(blk [][]string, pk []uint32)

Types

type Block

type Block struct {
	Offset int
	Block  []byte
	PK     []string
}

type ProgressBar added in v0.3.3

type ProgressBar interface {
	Add(int) error
	Finish() error
}

type Rows

type Rows struct {
	Offset int
	Rows   [][]string
}

type Sorter

type Sorter struct {
	PK []uint32

	Columns []string

	RowsCount uint32
	// contains filtered or unexported fields
}

Sorter sorts input CSV based on PK and output blocks of 255 rows each

func NewSorter

func NewSorter(runSize uint64, pt ProgressBar) (s *Sorter, err error)

func (*Sorter) AddRow

func (s *Sorter) AddRow(row []string) error

func (*Sorter) Close

func (s *Sorter) Close() error

func (*Sorter) SortFile

func (s *Sorter) SortFile(f io.ReadCloser, pk []string) (err error)

func (*Sorter) SortedBlocks

func (s *Sorter) SortedBlocks(removedCols map[int]struct{}, errChan chan<- error) (blocks chan *Block)

func (*Sorter) SortedRows

func (s *Sorter) SortedRows(removedCols map[int]struct{}, errChan chan<- error) (rowsCh chan *Rows)

Jump to

Keyboard shortcuts

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