format

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRETTY = iota
	CSVWITHNAMES
	CSV
	VALUES
	JSON
	TOML
)

Variables

View Source
var Formats = map[int]string{
	CSVWITHNAMES: "CSVWITHNAMES",
	CSV:          "CSV",
	VALUES:       "VALUES",
	JSON:         "JSON",
	TOML:         "TOML",
	PRETTY:       "PRETTY",
}

Functions

This section is empty.

Types

type BlockStreamFmtReader

type BlockStreamFmtReader interface {
	// BlockStreamFmtRead starts reading blocks, return stream of blocks to be consumed.
	// if ctx is cancelled, read will stop asap and channel will be closed
	// Yield blocks until the last BlockStreamFmtRead is completed
	// return total rows notFirstRow and error if any
	BlockStreamFmtRead(
		ctx context.Context, sample *data.Block, blockSize int,
	) (blockStream <-chan *data.Block, yield func() (int, error))
}

func BlockStreamFmtReaderFactory

func BlockStreamFmtReaderFactory(fmtType string, r io.Reader, settings map[string]interface{}) (BlockStreamFmtReader, error)

type BlockStreamFmtWriter

type BlockStreamFmtWriter interface {
	// BlockStreamFmtWrite starts writing stream of blocks into respective format, non blocking
	BlockStreamFmtWrite(blockStream <-chan *data.Block)
	// Yield blocks until all blocks are consumed from BlockStreamFmtWrite
	// returns total rows written and error if any
	Yield() (int, error)
}

BlockStreamFmtWriter writes data of block to it's respective format of it's concrete type

func BlockStreamFmtWriterFactory

func BlockStreamFmtWriterFactory(fmtType string, w io.Writer, settings map[string]interface{}) (BlockStreamFmtWriter, error)

type CSVBlockStreamFmtReader

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

func NewCSVBlockStreamFmtReader

func NewCSVBlockStreamFmtReader(input io.Reader, withNames bool, settings map[string]interface{}) (*CSVBlockStreamFmtReader, error)

func (*CSVBlockStreamFmtReader) BlockStreamFmtRead

func (c *CSVBlockStreamFmtReader) BlockStreamFmtRead(
	ctx context.Context, sample *data.Block, blockSize int,
) (blockStream <-chan *data.Block, yield func() (int, error))

func (*CSVBlockStreamFmtReader) ReadColumnTextsCont

func (c *CSVBlockStreamFmtReader) ReadColumnTextsCont(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*CSVBlockStreamFmtReader) ReadElem

func (c *CSVBlockStreamFmtReader) ReadElem(fb *bytepool.FrameBuffer, cols []*column.CHColumn, idx int) error

func (*CSVBlockStreamFmtReader) ReadFirstColumnTexts

func (c *CSVBlockStreamFmtReader) ReadFirstColumnTexts(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*CSVBlockStreamFmtReader) ReadFirstRow

func (c *CSVBlockStreamFmtReader) ReadFirstRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error

func (*CSVBlockStreamFmtReader) ReadRowCont

func (c *CSVBlockStreamFmtReader) ReadRowCont(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error

type CSVBlockStreamFmtWriter

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

func NewCSVBlockStreamFmtWriter

func NewCSVBlockStreamFmtWriter(w io.Writer, withNames bool, settings map[string]interface{}) (*CSVBlockStreamFmtWriter, error)

func (*CSVBlockStreamFmtWriter) BlockStreamFmtWrite

func (c *CSVBlockStreamFmtWriter) BlockStreamFmtWrite(blockStream <-chan *data.Block)

func (*CSVBlockStreamFmtWriter) Flush

func (c *CSVBlockStreamFmtWriter) Flush() error

func (*CSVBlockStreamFmtWriter) WriteFirstFrame

func (c *CSVBlockStreamFmtWriter) WriteFirstFrame(frame [][]string, cols []*column.CHColumn) (int, error)

func (*CSVBlockStreamFmtWriter) WriteFirstRow

func (c *CSVBlockStreamFmtWriter) WriteFirstRow(record []string, cols []*column.CHColumn) error

func (*CSVBlockStreamFmtWriter) WriteFrameCont

func (c *CSVBlockStreamFmtWriter) WriteFrameCont(frame [][]string, cols []*column.CHColumn) (int, error)

func (*CSVBlockStreamFmtWriter) WriteRowCont

func (c *CSVBlockStreamFmtWriter) WriteRowCont(record []string, cols []*column.CHColumn) error

func (*CSVBlockStreamFmtWriter) Yield

func (c *CSVBlockStreamFmtWriter) Yield() (int, error)

type JSONBlockStreamFmtReader

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

func NewJSONBlockStreamFmtReader

func NewJSONBlockStreamFmtReader(r io.Reader) *JSONBlockStreamFmtReader

func (*JSONBlockStreamFmtReader) BlockStreamFmtRead

func (j *JSONBlockStreamFmtReader) BlockStreamFmtRead(ctx context.Context, sample *data.Block, blockSize int,
) (blockStream <-chan *data.Block, yield func() (int, error))

func (*JSONBlockStreamFmtReader) ReadColumnTextsCont

func (j *JSONBlockStreamFmtReader) ReadColumnTextsCont(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*JSONBlockStreamFmtReader) ReadFirstColumnTexts

func (j *JSONBlockStreamFmtReader) ReadFirstColumnTexts(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*JSONBlockStreamFmtReader) ReadFirstRow

func (j *JSONBlockStreamFmtReader) ReadFirstRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn) (err error)

func (*JSONBlockStreamFmtReader) ReadRowCont

func (j *JSONBlockStreamFmtReader) ReadRowCont(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error

type JSONBlockStreamFmtWriter

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

func NewJSONBlockStreamFmtWriter

func NewJSONBlockStreamFmtWriter(w io.Writer) *JSONBlockStreamFmtWriter

func (*JSONBlockStreamFmtWriter) BlockStreamFmtWrite

func (j *JSONBlockStreamFmtWriter) BlockStreamFmtWrite(blockStream <-chan *data.Block)

func (*JSONBlockStreamFmtWriter) Flush

func (j *JSONBlockStreamFmtWriter) Flush() error

func (*JSONBlockStreamFmtWriter) WriteEnd

func (j *JSONBlockStreamFmtWriter) WriteEnd() error

func (*JSONBlockStreamFmtWriter) WriteFirstFrame

func (j *JSONBlockStreamFmtWriter) WriteFirstFrame(frame [][]string, cols []*column.CHColumn) (int, error)

func (*JSONBlockStreamFmtWriter) WriteFirstRow

func (j *JSONBlockStreamFmtWriter) WriteFirstRow(record []string, cols []*column.CHColumn) error

func (*JSONBlockStreamFmtWriter) WriteFrameCont

func (j *JSONBlockStreamFmtWriter) WriteFrameCont(frame [][]string, cols []*column.CHColumn) (int, error)

func (*JSONBlockStreamFmtWriter) WriteRowCont

func (j *JSONBlockStreamFmtWriter) WriteRowCont(record []string, cols []*column.CHColumn) error

func (*JSONBlockStreamFmtWriter) Yield

func (j *JSONBlockStreamFmtWriter) Yield() (int, error)

type PrettyBlockStreamFmtWriter

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

func NewPrettyBlockStreamFmtWriter

func NewPrettyBlockStreamFmtWriter(w io.Writer) *PrettyBlockStreamFmtWriter

func (*PrettyBlockStreamFmtWriter) BlockStreamFmtWrite

func (p *PrettyBlockStreamFmtWriter) BlockStreamFmtWrite(blockStream <-chan *data.Block)

func (*PrettyBlockStreamFmtWriter) Flush

func (p *PrettyBlockStreamFmtWriter) Flush() error

func (*PrettyBlockStreamFmtWriter) WriteFirstFrame

func (p *PrettyBlockStreamFmtWriter) WriteFirstFrame(frame [][]string, cols []*column.CHColumn) (int, error)

func (*PrettyBlockStreamFmtWriter) WriteFirstRow

func (p *PrettyBlockStreamFmtWriter) WriteFirstRow(record []string, cols []*column.CHColumn) error

func (*PrettyBlockStreamFmtWriter) WriteFrameCont

func (p *PrettyBlockStreamFmtWriter) WriteFrameCont(frame [][]string, cols []*column.CHColumn) (int, error)

func (*PrettyBlockStreamFmtWriter) WriteRowCont

func (p *PrettyBlockStreamFmtWriter) WriteRowCont(record []string, cols []*column.CHColumn) (err error)

func (*PrettyBlockStreamFmtWriter) Yield

func (p *PrettyBlockStreamFmtWriter) Yield() (int, error)

type ValuesBlockStreamFmtReader

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

func NewValuesBlockStreamReader

func NewValuesBlockStreamReader(r io.Reader) *ValuesBlockStreamFmtReader

func (*ValuesBlockStreamFmtReader) BlockStreamFmtRead

func (v *ValuesBlockStreamFmtReader) BlockStreamFmtRead(ctx context.Context, sample *data.Block, blockSize int,
) (blockStream <-chan *data.Block, yield func() (int, error))

func (*ValuesBlockStreamFmtReader) ReadColumnTextsCont

func (v *ValuesBlockStreamFmtReader) ReadColumnTextsCont(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*ValuesBlockStreamFmtReader) ReadElem

func (v *ValuesBlockStreamFmtReader) ReadElem(fb *bytepool.FrameBuffer, cols []*column.CHColumn, idx int) error

func (*ValuesBlockStreamFmtReader) ReadFirstColumnTexts

func (v *ValuesBlockStreamFmtReader) ReadFirstColumnTexts(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn) (int, error)

func (*ValuesBlockStreamFmtReader) ReadFirstRow

func (v *ValuesBlockStreamFmtReader) ReadFirstRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error

func (*ValuesBlockStreamFmtReader) ReadRowCont

func (v *ValuesBlockStreamFmtReader) ReadRowCont(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error

type ValuesBlockStreamFmtWriter

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

func NewValuesBlockStreamFmtWriter

func NewValuesBlockStreamFmtWriter(w io.Writer) *ValuesBlockStreamFmtWriter

func (*ValuesBlockStreamFmtWriter) BlockStreamFmtWrite

func (v *ValuesBlockStreamFmtWriter) BlockStreamFmtWrite(blockStream <-chan *data.Block)

func (*ValuesBlockStreamFmtWriter) Flush

func (v *ValuesBlockStreamFmtWriter) Flush() error

func (*ValuesBlockStreamFmtWriter) WriteFirstFrame

func (v *ValuesBlockStreamFmtWriter) WriteFirstFrame(frame [][]string, cols []*column.CHColumn) (int, error)

func (*ValuesBlockStreamFmtWriter) WriteFirstRow

func (v *ValuesBlockStreamFmtWriter) WriteFirstRow(record []string, cols []*column.CHColumn) error

func (*ValuesBlockStreamFmtWriter) WriteFrameCont

func (v *ValuesBlockStreamFmtWriter) WriteFrameCont(frame [][]string, cols []*column.CHColumn) (int, error)

func (*ValuesBlockStreamFmtWriter) WriteRowCont

func (v *ValuesBlockStreamFmtWriter) WriteRowCont(record []string, cols []*column.CHColumn) error

func (*ValuesBlockStreamFmtWriter) Yield

func (v *ValuesBlockStreamFmtWriter) Yield() (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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