data

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ClickHouseRevision         = 54213
	ClickHouseRevision = 54406 //To receive server logs, we have to update the client revision
	//ClickHouseRevision         = protocol.DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO //To receive TableColumn Metadata which is being expected by clickhouse-client
	//ClickHouseDBMSVersionMajor = 1
	ClickHouseDBMSVersionMajor = 0
	ClickHouseDBMSVersionMinor = 1
)
View Source
const ClientName = "Enhanced Golang SQLDriver"

Variables

This section is empty.

Functions

func NewBlocksPrinter

func NewBlocksPrinter(balanceRow int) *blocksPrinter

NewBlocksPrinter creates a new blockPrinter instance which used to print blocks balanceRow is the number of rows you want to print for the query If no more balanceRow, block data won't be printed Example usage: var sb strings.Builder printer := NewBlocksPrinter(100) printer.Print(block1, &sb) printer.Print(block2, &sb) fmt.Println(sb.String())

func WriteBlockToEncoder

func WriteBlockToEncoder(encoder *ch_encoding.Encoder, b *Block) error

func WriteClientInfo

func WriteClientInfo(encoder *ch_encoding.Encoder) (err error)

Types

type Block

type Block struct {
	NumColumns int
	NumRows    int
	Columns    []*column.CHColumn
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(colNames []string, colTypes []column.CHColumnType, numRows int) (*Block, error)

func NewBlockWithLocation

func NewBlockWithLocation(colNames []string, colTypes []column.CHColumnType, numRows int, location *time.Location) (*Block, error)

func ReadBlockFromDecoder

func ReadBlockFromDecoder(decoder *ch_encoding.Decoder) (*Block, error)

func ReadBlockFromDecoderWithLocation

func ReadBlockFromDecoderWithLocation(decoder *ch_encoding.Decoder, location *time.Location) (*Block, error)

func (*Block) Close

func (b *Block) Close() error

func (*Block) ColumnNames

func (b *Block) ColumnNames() []string

func (*Block) NewStringFrame

func (b *Block) NewStringFrame() [][]string

NewStringFrame returns an empty 2 dimensional string with dimensions same as the NumRows and NumColumns of the block.

func (*Block) NewValuesFrame

func (b *Block) NewValuesFrame() [][]interface{}

NewValuesFrame returns an empty 2 dimensional interface with dimensions same as the NumRows and NumColumns of the block.

func (*Block) PrettyFmtBuild

func (b *Block) PrettyFmtBuild(builder *strings.Builder)

func (*Block) ReadFromColumnTexts

func (b *Block) ReadFromColumnTexts(columnTexts [][]string) (rowsRead, columnsRead int, err error)

ReadFromColumnTexts attempts to read columnTexts into current block. return numbers of rows read, columns read and error if any. if err occurs during read, return the first total num of rows before error occur for that column instead.

func (*Block) ReadFromColumnValues

func (b *Block) ReadFromColumnValues(colValues [][]interface{}) (rowsRead, columnsRead int, err error)

func (*Block) StructureCopy

func (b *Block) StructureCopy(numRows int) *Block

StructureCopy copies the metadata of Block, with n rows

func (*Block) WriteRowToStrings

func (b *Block) WriteRowToStrings(record []string, row int)

func (*Block) WriteRowToValues

func (b *Block) WriteRowToValues(record []interface{}, row int)

func (*Block) WriteToStrings

func (b *Block) WriteToStrings(frame [][]string)

WriteToStrings attempts to read to dataframe, panics if numRows and numCols exceed the dimension of dataframe. Callers are expected to check dimension of dataframe passed in.

func (*Block) WriteToStringsV2

func (b *Block) WriteToStringsV2(frame [][]string)

WriteToStringsV2 is similar to WriteToStrings but using the boundaries of the given frame instead of boundaries of block.

func (*Block) WriteToValues

func (b *Block) WriteToValues(values [][]interface{})

func (*Block) WriteValuesAsString

func (b *Block) WriteValuesAsString(frame [][]interface{})

type ServerInfo

type ServerInfo struct {
	Name         string
	Revision     uint64
	MinorVersion uint64
	MajorVersion uint64
	Timezone     *time.Location

	//Additional information since we upgraded the client revision number to 54406 (DBMS_MIN_REVISION_WITH_SERVER_LOGS)
	DisplayName  string
	VersionPatch uint64
}

func ReadServerInfo

func ReadServerInfo(decoder *ch_encoding.Decoder) (*ServerInfo, error)

func (*ServerInfo) String

func (s *ServerInfo) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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