redshift

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SMALLINT  = iota
	INTEGER   = iota
	BIGINT    = iota
	DECIMAL   = iota
	DOUBLE    = iota
	BOOLEAN   = iota
	CHAR      = iota
	VARCHAR   = iota
	DATE      = iota
	TIMESTAMP = iota
)
View Source
const SQLDateFormat = "2006-01-02"

Variables

This section is empty.

Functions

func DefaultDelimiter

func DefaultDelimiter() string

Types

type AWSConfiguration

type AWSConfiguration struct {
	Redshift *RedshiftConnectionDetails `yaml:"redshift"`
	S3       *S3Configuration           `yaml:"s3"`
}

func ParseAWSConfiguration

func ParseAWSConfiguration(file *os.File) (*AWSConfiguration, error)

type Client

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

func NewClient

func NewClient(config *AWSConfiguration) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) ExtractSchema

func (c *Client) ExtractSchema(table string) (*TableSchema, error)

func (*Client) Unload

func (c *Client) Unload(table string, partition *DatePartition, whereClause string) (*UnloadResult, error)

type Column

type Column struct {
	Name string
	Type int
}

func (*Column) String

func (c *Column) String() string

type DatePartition

type DatePartition struct {
	DateExpression string    // expression used to extract relevant date for each row
	DateFilter     time.Time // current partition date
}

func NewDatePartition

func NewDatePartition(expression string, t time.Time) *DatePartition

type RedshiftConnectionDetails

type RedshiftConnectionDetails struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Database string `yaml:"db"`
	Password string `yaml:"password"`
}

func (*RedshiftConnectionDetails) URLString

func (c *RedshiftConnectionDetails) URLString() string

type RedshiftSource

type RedshiftSource struct {
	Table       string
	Schema      *TableSchema
	Partition   *DatePartition
	WhereClause string
}

func (*RedshiftSource) SelectClause

func (s *RedshiftSource) SelectClause() string

type S3Configuration

type S3Configuration struct {
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
}

func (S3Configuration) ToRedshiftCredentialsClause

func (c S3Configuration) ToRedshiftCredentialsClause() string

type TableSchema

type TableSchema struct {
	Columns []*Column
}

func (*TableSchema) String

func (t *TableSchema) String() string

func (*TableSchema) ToBigQuerySchema

func (in *TableSchema) ToBigQuerySchema() (*bq.TableSchema, error)

type UnloadResult

type UnloadResult struct {
	Bucket       string
	ObjectPrefix string
}

Jump to

Keyboard shortcuts

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