file

package
v0.0.0-...-8ffd201 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadRowsNumber = 10000
)

Variables

This section is empty.

Functions

func NewFileMetadata

func NewFileMetadata(conf *config.FileConnector) (*metadata.Metadata, error)

Types

type CSV

type CSV struct {
	Closer      io.Closer
	Metadata    *metadata.Metadata
	Reader      *csv.Reader
	Writer      *csv.Writer
	Indexes     []int
	OutMetadata *metadata.Metadata
}

func NewCSV

func NewCSV(osFile *os.File, md *metadata.Metadata) *CSV

func (*CSV) Read

func (csv *CSV) Read(indexes []int) (*row.RowsGroup, error)

func (*CSV) SetColumns

func (csv *CSV) SetColumns(indexes []int) error

func (*CSV) Write

func (csv *CSV) Write(rb *row.RowsBuffer, indexes []int) (affectedRows int64, err error)

type File

type File struct {
	Config    *config.FileConnector
	Metadata  *metadata.Metadata
	FileType  partition.FileType
	Partition *partition.Partition
}

func NewFileConnector

func NewFileConnector(catalog, schema, table string) (*File, error)

func NewFileConnectorEmpty

func NewFileConnectorEmpty() *File

func (*File) GetMetadata

func (c *File) GetMetadata() (*metadata.Metadata, error)

func (*File) GetPartition

func (c *File) GetPartition(_ int) (*partition.Partition, error)

func (*File) GetReader

func (c *File) GetReader(file *partition.FileLocation, selectedMD *metadata.Metadata, _ []string) (row.GroupReader, error)

func (*File) Insert

func (c *File) Insert(rb *row.RowsBuffer, columns []string) (affectedRows int64, err error)

func (*File) ShowColumns

func (c *File) ShowColumns(catalog, schema, table string) row.Reader

func (*File) ShowPartitions

func (c *File) ShowPartitions(_, _, _ string) row.Reader

func (*File) ShowSchemas

func (c *File) ShowSchemas(catalog string, _, _ *string) row.Reader

func (*File) ShowTables

func (c *File) ShowTables(catalog, schema string, _, _ *string) row.Reader

type Handler

type Handler interface {
	Read(indexes []int) (rg *row.RowsGroup, err error)
	Write(rb *row.RowsBuffer, indexes []int) (affectedRows int64, err error)
}

func NewHandler

func NewHandler(file *partition.FileLocation, md *metadata.Metadata, readonly bool) (Handler, error)

Jump to

Keyboard shortcuts

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