Documentation ¶
Index ¶
- func AssertNextByteEqual(z *bytepool.ZReader, expect byte) error
- func BlockToFrame(blockStream <-chan *data.Block) (<-chan [][]string, []*column.CHColumn, func([][]string), bool)
- func DiscardUntilByteEscaped(z *bytepool.ZReader, stop byte) error
- func FlushZReader(z *bytepool.ZReader)
- func ReadCHElemTillStop(w Writer, z *bytepool.ZReader, col column.CHColumnData, stop byte) error
- func ReadColumnTextsCont(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn, ...) (int, error)
- func ReadFirstColumnTexts(fb *bytepool.FrameBuffer, numRows int, cols []*column.CHColumn, ...) (int, error)
- func ReadNextNonSpaceByte(z *bytepool.ZReader) (byte, error)
- func ReadNextNonSpaceExceptNewLineByte(z *bytepool.ZReader) (byte, error)
- func ReadRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn, e ElemReader) error
- func ReadStringUntilByte(w Writer, z *bytepool.ZReader, b byte) (int, error)
- func TableToBlockStream(ctx context.Context, sample *data.Block, blockSize int, tReader TableReader) (blockStream <-chan *data.Block, yield func() (int, error))
- func WriteCHElemString(w io.Writer, s string, col *column.CHColumn) error
- func WriteFirstFrame(frame [][]string, cols []*column.CHColumn, rWriter RowWriter) (int, error)
- func WriteFrameCont(frame [][]string, cols []*column.CHColumn, rWriter RowWriter) (int, error)
- func WriteTableFromBlockStream(blockStream <-chan *data.Block, tWriter TableWriter) (int, error)
- func YieldTableStream(eg *errgroup.Group, colTextsStreamer *ColumnTextsStreamer, ...) func() (int, error)
- type ColumnTextsPool
- type ColumnTextsResult
- type ColumnTextsStreamer
- type ColumnTextsToBlock
- type ElemReader
- type ReadColumnTexts
- type RecycleColumnTexts
- type RowReader
- type RowWriter
- type TableReader
- type TableWriter
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNextByteEqual ¶
AssertNextByteEqual reads the next non space byte from z throws error if byte is not same as expect
func BlockToFrame ¶
func BlockToFrame(blockStream <-chan *data.Block) (<-chan [][]string, []*column.CHColumn, func([][]string), bool)
BlockToFrame converts all blocks to respective string frame in order. assumes that blocks coming at least have 1 row. returns false if channel is closed initially.
func FlushZReader ¶
func ReadCHElemTillStop ¶
func ReadColumnTextsCont ¶
func ReadFirstColumnTexts ¶
func ReadRow ¶
func ReadRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn, e ElemReader) error
func ReadStringUntilByte ¶
ReadStringUntilByte reads content of buffer until including given byte appear or EOF Write the bytes into Writer Returns number of bytes (excluding quote) written and error
func TableToBlockStream ¶
func WriteFirstFrame ¶
func WriteFrameCont ¶
func WriteTableFromBlockStream ¶
func WriteTableFromBlockStream(blockStream <-chan *data.Block, tWriter TableWriter) (int, error)
func YieldTableStream ¶
func YieldTableStream(eg *errgroup.Group, colTextsStreamer *ColumnTextsStreamer, toBlockProcess *ColumnTextsToBlock, ) func() (int, error)
Types ¶
type ColumnTextsPool ¶
type ColumnTextsPool struct {
// contains filtered or unexported fields
}
func NewColumnTextsPool ¶
func NewColumnTextsPool(numCols, numRows int) *ColumnTextsPool
func (*ColumnTextsPool) NewColumnTextsResult ¶
func (c *ColumnTextsPool) NewColumnTextsResult(fb *bytepool.FrameBuffer) *ColumnTextsResult
type ColumnTextsResult ¶
type ColumnTextsResult struct {
// contains filtered or unexported fields
}
func (*ColumnTextsResult) Close ¶
func (c *ColumnTextsResult) Close()
func (*ColumnTextsResult) Get ¶
func (c *ColumnTextsResult) Get() [][]string
type ColumnTextsStreamer ¶
type ColumnTextsStreamer struct {
// contains filtered or unexported fields
}
func NewColumnTextsStreamer ¶
func NewColumnTextsStreamer(sample *data.Block, blockSize int, tReader TableReader) *ColumnTextsStreamer
func (*ColumnTextsStreamer) Finish ¶
func (c *ColumnTextsStreamer) Finish() (int, error)
func (*ColumnTextsStreamer) Start ¶
func (c *ColumnTextsStreamer) Start(ctx context.Context) <-chan *ColumnTextsResult
type ColumnTextsToBlock ¶
type ColumnTextsToBlock struct {
// contains filtered or unexported fields
}
func NewColumnTextsToBlock ¶
func NewColumnTextsToBlock(ctStream <-chan *ColumnTextsResult, sample *data.Block) *ColumnTextsToBlock
func (*ColumnTextsToBlock) Error ¶
func (a *ColumnTextsToBlock) Error() error
func (*ColumnTextsToBlock) Finish ¶
func (a *ColumnTextsToBlock) Finish() (rowsProcessed int, err error)
type ElemReader ¶
type ReadColumnTexts ¶
type RecycleColumnTexts ¶
type RecycleColumnTexts func(columnTexts [][]string)
var RecycleColumnTextsNoOp RecycleColumnTexts = func(columnTexts [][]string) {}
type RowReader ¶
type RowReader interface { ReadFirstRow(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error ReadRowCont(fb *bytepool.FrameBuffer, cols []*column.CHColumn) error }
type TableReader ¶
type TableWriter ¶
type TableWriter interface { // WriteFirstFrame writes the first frame generated from the first block with data from server. // meant for writing Headers if any (eg. JSON) // return number of rows written and error if any. WriteFirstFrame(frame [][]string, cols []*column.CHColumn) (int, error) // WriteFrameCont is same as WriteFirstFrame but not for first row WriteFrameCont(frame [][]string, cols []*column.CHColumn) (int, error) // Flush indicates all blocks are read and caller should write any last data and do clean up Flush() error }
type Writer ¶
type Writer interface { io.Writer io.StringWriter io.ByteWriter }
Click to show internal directories.
Click to hide internal directories.