etl

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const BatchSize = 8192
View Source
const MAX_INSERT_TIME = 3 * time.Second

Variables

This section is empty.

Functions

func GetVectorArrayLen

func GetVectorArrayLen(ctx context.Context, vec *vector.Vector) (int, error)

func ValToString

func ValToString(ctx context.Context, vec *vector.Vector, rowIdx int) (string, error)

Types

type BufWriter added in v0.8.0

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

func NewBufWriter added in v0.8.0

func NewBufWriter(ctx context.Context, writer io.Writer) *BufWriter

func (*BufWriter) Close added in v0.8.0

func (w *BufWriter) Close() error

func (*BufWriter) Write added in v0.8.0

func (w *BufWriter) Write(p []byte) (n int, err error)

type CSVWriter

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

func NewCSVWriter

func NewCSVWriter(ctx context.Context, writer io.StringWriter) *CSVWriter

func (*CSVWriter) FlushAndClose

func (w *CSVWriter) FlushAndClose() (int, error)

func (*CSVWriter) GetContent

func (w *CSVWriter) GetContent() string

func (*CSVWriter) WriteRow

func (w *CSVWriter) WriteRow(row *table.Row) error

func (*CSVWriter) WriteStrings

func (w *CSVWriter) WriteStrings(record []string) error

type DefaultSqlWriter added in v0.8.0

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

DefaultSqlWriter SqlWriter is a writer that writes data to a SQL database.

func NewSqlWriter added in v0.8.0

func NewSqlWriter(ctx context.Context, tbl *table.Table, csv *CSVWriter) *DefaultSqlWriter

func (*DefaultSqlWriter) FlushAndClose added in v0.8.0

func (sw *DefaultSqlWriter) FlushAndClose() (int, error)

func (*DefaultSqlWriter) GetContent added in v0.8.0

func (sw *DefaultSqlWriter) GetContent() string

func (*DefaultSqlWriter) WriteRow added in v0.8.0

func (sw *DefaultSqlWriter) WriteRow(row *table.Row) error

func (*DefaultSqlWriter) WriteStrings added in v0.8.0

func (sw *DefaultSqlWriter) WriteStrings(record []string) error

type FSWriter

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

func NewFSWriter

func NewFSWriter(ctx context.Context, fs fileservice.FileService, opts ...FSWriterOption) *FSWriter

func (*FSWriter) Write

func (w *FSWriter) Write(p []byte) (n int, err error)

Write implement io.Writer, Please execute in series

func (*FSWriter) WriteString

func (w *FSWriter) WriteString(s string) (n int, err error)

WriteString implement io.StringWriter

type FSWriterOption

type FSWriterOption func(*FSWriter)

func WithFilePath

func WithFilePath(filepath string) FSWriterOption

func (FSWriterOption) Apply

func (f FSWriterOption) Apply(w *FSWriter)

type TAEReader

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

TAEReader implements the io.Reader interface for reading a tae file. Deprecated

func NewTaeReader

func NewTaeReader(ctx context.Context, tbl *table.Table, filePath string, filesize int64, fs fileservice.FileService, mp *mpool.MPool) (*TAEReader, error)

NewTaeReader returns a TAEReader. Deprecated

func (*TAEReader) Close

func (r *TAEReader) Close()

func (*TAEReader) ReadAll

func (r *TAEReader) ReadAll(ctx context.Context) ([]*batch.Batch, error)

func (*TAEReader) ReadLine

func (r *TAEReader) ReadLine() ([]string, error)

func (*TAEReader) ReadRow

func (r *TAEReader) ReadRow(row *table.Row) error

type TAEWriter

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

TAEWriter implements table.RowWriter and writes data to a tae file. Deprecated

func NewTAEWriter

func NewTAEWriter(ctx context.Context, tbl *table.Table, mp *mpool.MPool, filePath string, fs fileservice.FileService) *TAEWriter

NewTAEWriter returns a new instance of TAEWriter Deprecated

func (*TAEWriter) FlushAndClose

func (w *TAEWriter) FlushAndClose() (int, error)

FlushAndClose implement ETLWriter

func (*TAEWriter) GetContent

func (w *TAEWriter) GetContent() string

func (*TAEWriter) WriteRow

func (w *TAEWriter) WriteRow(row *table.Row) error

WriteRow implement ETLWriter

func (*TAEWriter) WriteStrings

func (w *TAEWriter) WriteStrings(Line []string) error

WriteStrings implement ETLWriter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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