s3select

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package s3select provides S3 Select input/output options and result helpers.

Package select provides SelectObjectContent helpers.

Package select provides SelectObjectContent helpers.

Package select provides SelectObjectContent helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVFileHeaderInfo

type CSVFileHeaderInfo string

CSVFileHeaderInfo controls how CSV headers are handled.

const (
	CSVFileHeaderInfoNone   CSVFileHeaderInfo = "NONE"
	CSVFileHeaderInfoIgnore CSVFileHeaderInfo = "IGNORE"
	CSVFileHeaderInfoUse    CSVFileHeaderInfo = "USE"
)

type CSVInputOptions

type CSVInputOptions struct {
	FileHeaderInfo CSVFileHeaderInfo

	RecordDelimiter string

	FieldDelimiter string

	QuoteCharacter string

	QuoteEscapeCharacter string

	Comments string
	// contains filtered or unexported fields
}

CSVInputOptions describes CSV input options.

func (CSVInputOptions) MarshalXML

func (c CSVInputOptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML renders CSV input options as XML.

func (*CSVInputOptions) SetComments

func (c *CSVInputOptions) SetComments(val string)

SetComments sets the comments character in the CSV input options.

func (*CSVInputOptions) SetFieldDelimiter

func (c *CSVInputOptions) SetFieldDelimiter(val string)

SetFieldDelimiter sets the field delimiter in the CSV input options.

func (*CSVInputOptions) SetFileHeaderInfo

func (c *CSVInputOptions) SetFileHeaderInfo(val CSVFileHeaderInfo)

SetFileHeaderInfo sets the file header info in the CSV input options.

func (*CSVInputOptions) SetQuoteCharacter

func (c *CSVInputOptions) SetQuoteCharacter(val string)

SetQuoteCharacter sets the quote character in the CSV input options.

func (*CSVInputOptions) SetQuoteEscapeCharacter

func (c *CSVInputOptions) SetQuoteEscapeCharacter(val string)

SetQuoteEscapeCharacter sets the quote escape character in the CSV input options.

func (*CSVInputOptions) SetRecordDelimiter

func (c *CSVInputOptions) SetRecordDelimiter(val string)

SetRecordDelimiter sets the record delimiter in the CSV input options.

type CSVOutputOptions

type CSVOutputOptions struct {
	QuoteFields CSVQuoteFields

	RecordDelimiter string

	FieldDelimiter string

	QuoteCharacter string

	QuoteEscapeCharacter string
	// contains filtered or unexported fields
}

CSVOutputOptions describes CSV output options.

func (CSVOutputOptions) MarshalXML

func (c CSVOutputOptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML renders CSV output options as XML.

func (*CSVOutputOptions) SetFieldDelimiter

func (c *CSVOutputOptions) SetFieldDelimiter(val string)

SetFieldDelimiter sets the field delimiter character in the CSV output options.

func (*CSVOutputOptions) SetQuoteCharacter

func (c *CSVOutputOptions) SetQuoteCharacter(val string)

SetQuoteCharacter sets the quote character in the CSV output options.

func (*CSVOutputOptions) SetQuoteEscapeCharacter

func (c *CSVOutputOptions) SetQuoteEscapeCharacter(val string)

SetQuoteEscapeCharacter sets the quote escape character in the CSV output options.

func (*CSVOutputOptions) SetQuoteFields

func (c *CSVOutputOptions) SetQuoteFields(val CSVQuoteFields)

SetQuoteFields sets the quote field parameter in the CSV output options.

func (*CSVOutputOptions) SetRecordDelimiter

func (c *CSVOutputOptions) SetRecordDelimiter(val string)

SetRecordDelimiter sets the record delimiter character in the CSV output options.

type CSVQuoteFields

type CSVQuoteFields string

CSVQuoteFields controls how CSV fields are quoted.

const (
	CSVQuoteFieldsAlways   CSVQuoteFields = "Always"
	CSVQuoteFieldsAsNeeded CSVQuoteFields = "AsNeeded"
)

type InputSerialization

type InputSerialization struct {
	CompressionType SelectCompressionType `xml:"CompressionType,omitempty"`
	Parquet         *ParquetInputOptions  `xml:"Parquet,omitempty"`
	CSV             *CSVInputOptions      `xml:"CSV,omitempty"`
	JSON            *JSONInputOptions     `xml:"JSON,omitempty"`
}

InputSerialization describes the input serialization for select.

type JSONInputOptions

type JSONInputOptions struct {
	Type JSONType
	// contains filtered or unexported fields
}

JSONInputOptions describes JSON input options.

func (JSONInputOptions) MarshalXML

func (j JSONInputOptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML renders JSON input options as XML.

func (*JSONInputOptions) SetType

func (j *JSONInputOptions) SetType(typ JSONType)

SetType sets the JSON type in the JSON input options.

type JSONOutputOptions

type JSONOutputOptions struct {
	RecordDelimiter string
	// contains filtered or unexported fields
}

JSONOutputOptions describes JSON output options.

func (JSONOutputOptions) MarshalXML

func (j JSONOutputOptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML renders JSON output options as XML.

func (*JSONOutputOptions) SetRecordDelimiter

func (j *JSONOutputOptions) SetRecordDelimiter(val string)

SetRecordDelimiter sets the record delimiter in the JSON output options.

type JSONType

type JSONType string

JSONType determines JSON input serialization type.

const (
	JSONDocumentType JSONType = "DOCUMENT"
	JSONLinesType    JSONType = "LINES"
)

type Options

type Options struct {
	XMLName xml.Name `xml:"SelectObjectContentRequest"`

	Expression           string              `xml:"Expression"`
	ExpressionType       QueryExpressionType `xml:"ExpressionType"`
	InputSerialization   InputSerialization  `xml:"InputSerialization"`
	OutputSerialization  OutputSerialization `xml:"OutputSerialization"`
	RequestProgress      RequestProgress     `xml:"RequestProgress"`
	ServerSideEncryption sse.Encrypter       `xml:"-"`
}

Options represents the select request payload.

func (Options) Header

func (o Options) Header() http.Header

Header returns HTTP headers for a select request.

type OutputSerialization

type OutputSerialization struct {
	CSV  *CSVOutputOptions  `xml:"CSV,omitempty"`
	JSON *JSONOutputOptions `xml:"JSON,omitempty"`
}

OutputSerialization describes the output serialization for select.

type ParquetInputOptions

type ParquetInputOptions struct{}

ParquetInputOptions describes Parquet input options.

type ProgressMessage

type ProgressMessage struct {
	XMLName xml.Name `xml:"Progress"`
	StatsMessage
}

ProgressMessage contains progress XML messages.

type QueryExpressionType

type QueryExpressionType string

QueryExpressionType describes the query language.

const (
	QueryExpressionTypeSQL QueryExpressionType = "SQL"
)

type RequestProgress

type RequestProgress struct {
	Enabled bool `xml:"Enabled"`
}

RequestProgress controls select progress messages.

type Results

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

Results provides a streaming reader for select output.

func NewResults

func NewResults(resp *http.Response, bucketName, objectName string) (*Results, error)

NewResults creates a select result parser and starts streaming.

func (*Results) Close

func (s *Results) Close() error

Close closes the response body and stream reader.

func (*Results) Progress

func (s *Results) Progress() *ProgressMessage

Progress returns select progress updates.

func (*Results) Read

func (s *Results) Read(b []byte) (n int, err error)

Read reads select records from the stream.

func (*Results) Stats

func (s *Results) Stats() *StatsMessage

Stats returns select stats after completion.

type SelectCompressionType

type SelectCompressionType string

SelectCompressionType describes input compression.

const (
	SelectCompressionNone   SelectCompressionType = "NONE"
	SelectCompressionGZIP   SelectCompressionType = "GZIP"
	SelectCompressionBZIP   SelectCompressionType = "BZIP2"
	SelectCompressionZSTD   SelectCompressionType = "ZSTD"
	SelectCompressionLZ4    SelectCompressionType = "LZ4"
	SelectCompressionS2     SelectCompressionType = "S2"
	SelectCompressionSNAPPY SelectCompressionType = "SNAPPY"
)

type StatsMessage

type StatsMessage struct {
	XMLName        xml.Name `xml:"Stats"`
	BytesScanned   int64
	BytesProcessed int64
	BytesReturned  int64
}

StatsMessage contains select stats.

Jump to

Keyboard shortcuts

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