arrowbatches

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UseNanosecondTimestamp  = ia.UseNanosecondTimestamp
	UseMicrosecondTimestamp = ia.UseMicrosecondTimestamp
	UseMillisecondTimestamp = ia.UseMillisecondTimestamp
	UseSecondTimestamp      = ia.UseSecondTimestamp
	UseOriginalTimestamp    = ia.UseOriginalTimestamp
)

Timestamp option constants.

Variables

This section is empty.

Functions

func ArrowSnowflakeTimestampToTime

func ArrowSnowflakeTimestampToTime(
	column arrow.Array,
	sfType types.SnowflakeType,
	scale int,
	recIdx int,
	loc *time.Location) *time.Time

ArrowSnowflakeTimestampToTime converts original timestamp returned by Snowflake to time.Time.

func WithArrowBatches

func WithArrowBatches(ctx context.Context) context.Context

WithArrowBatches returns a context that enables arrow batch mode for queries.

func WithTimestampOption

func WithTimestampOption(ctx context.Context, option ia.TimestampOption) context.Context

WithTimestampOption returns a context that sets the timestamp conversion option for arrow batches.

func WithUtf8Validation

func WithUtf8Validation(ctx context.Context) context.Context

WithUtf8Validation returns a context that enables UTF-8 validation for string columns in arrow batches.

Types

type ArrowBatch

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

ArrowBatch represents a chunk of data retrievable in arrow.Record format.

func GetArrowBatches

func GetArrowBatches(rows sf.SnowflakeRows) ([]*ArrowBatch, error)

GetArrowBatches retrieves arrow batches from SnowflakeRows. The rows must have been queried with arrowbatches.WithArrowBatches(ctx).

func (*ArrowBatch) ArrowSnowflakeTimestampToTime

func (rb *ArrowBatch) ArrowSnowflakeTimestampToTime(rec arrow.Record, colIdx int, recIdx int) *time.Time

ArrowSnowflakeTimestampToTime converts an original Snowflake timestamp to time.Time.

func (*ArrowBatch) Fetch

func (rb *ArrowBatch) Fetch() (*[]arrow.Record, error)

Fetch returns an array of arrow.Record representing this batch's data. Records are transformed from Snowflake's internal format to standard Arrow types.

func (*ArrowBatch) GetAllocator

func (rb *ArrowBatch) GetAllocator() memory.Allocator

GetAllocator returns the memory allocator for this batch.

func (*ArrowBatch) GetLocation

func (rb *ArrowBatch) GetLocation() *time.Location

GetLocation returns the timezone location for this batch.

func (*ArrowBatch) GetRowCount

func (rb *ArrowBatch) GetRowCount() int

GetRowCount returns the number of rows in this batch.

func (*ArrowBatch) GetRowTypes

func (rb *ArrowBatch) GetRowTypes() []query.ExecResponseRowType

GetRowTypes returns the column metadata for this batch.

func (*ArrowBatch) WithContext

func (rb *ArrowBatch) WithContext(ctx context.Context) *ArrowBatch

WithContext sets the context for subsequent Fetch calls on this batch.

Jump to

Keyboard shortcuts

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